summaryrefslogtreecommitdiff
path: root/libavformat/rtp_mpv.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2009-06-10 14:56:50 +0000
committerLuca Barbato <lu_zero@gentoo.org>2009-06-10 14:56:50 +0000
commit4db819bc7f47f1fe41caec63ad6122d2c999c95c (patch)
tree254a57a99ea290ae8637166b8130aa051a2c329d /libavformat/rtp_mpv.c
parentb19d493f2b9b59e50547c6ccb0d4d68c29267923 (diff)
Make sure buffer end remains constant within the loop
otherwise ff_find_start_code could read over the buffer size Originally committed as revision 19142 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp_mpv.c')
-rw-r--r--libavformat/rtp_mpv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/rtp_mpv.c b/libavformat/rtp_mpv.c
index f3f4501367..b23c8f86e8 100644
--- a/libavformat/rtp_mpv.c
+++ b/libavformat/rtp_mpv.c
@@ -31,6 +31,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
RTPMuxContext *s = s1->priv_data;
int len, h, max_packet_size;
uint8_t *q;
+ const uint8_t *end = buf1 + size;
int begin_of_slice, end_of_slice, frame_type, temporal_reference;
max_packet_size = s->max_payload_size;
@@ -55,7 +56,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
r1 = buf1;
while (1) {
start_code = -1;
- r = ff_find_start_code(r1, buf1 + size, &start_code);
+ r = ff_find_start_code(r1, end, &start_code);
if((start_code & 0xFFFFFF00) == 0x100) {
/* New start code found */
if (start_code == 0x100) {