mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 10:30:05 +01:00
avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
Fixes: memcpy with negative size
Fixes: momo_trip-poc/input
Reported-by: Momoko Shiraishi <shiraishi@os.is.s.u-tokyo.ac.jp>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d03483bd26)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -195,6 +195,9 @@ void ff_rtp_send_h264_hevc(AVFormatContext *s1, const uint8_t *buf1, int size)
|
|||||||
r1 = ff_avc_mp4_find_startcode(r, end, s->nal_length_size);
|
r1 = ff_avc_mp4_find_startcode(r, end, s->nal_length_size);
|
||||||
if (!r1)
|
if (!r1)
|
||||||
r1 = end;
|
r1 = end;
|
||||||
|
// Check that the last is not truncated
|
||||||
|
if (r1 - r < s->nal_length_size)
|
||||||
|
break;
|
||||||
r += s->nal_length_size;
|
r += s->nal_length_size;
|
||||||
} else {
|
} else {
|
||||||
while (!*(r++));
|
while (!*(r++));
|
||||||
|
|||||||
Reference in New Issue
Block a user