mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
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
This commit is contained in:
parent
b19d493f2b
commit
4db819bc7f
@ -31,6 +31,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
|
|||||||
RTPMuxContext *s = s1->priv_data;
|
RTPMuxContext *s = s1->priv_data;
|
||||||
int len, h, max_packet_size;
|
int len, h, max_packet_size;
|
||||||
uint8_t *q;
|
uint8_t *q;
|
||||||
|
const uint8_t *end = buf1 + size;
|
||||||
int begin_of_slice, end_of_slice, frame_type, temporal_reference;
|
int begin_of_slice, end_of_slice, frame_type, temporal_reference;
|
||||||
|
|
||||||
max_packet_size = s->max_payload_size;
|
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;
|
r1 = buf1;
|
||||||
while (1) {
|
while (1) {
|
||||||
start_code = -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) {
|
if((start_code & 0xFFFFFF00) == 0x100) {
|
||||||
/* New start code found */
|
/* New start code found */
|
||||||
if (start_code == 0x100) {
|
if (start_code == 0x100) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user