mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-27 09:11:17 +00:00
avformat/rtpenc_jpeg: Check remaining buffer size for SOS
Fixes CID1238818
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81198a6837
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1973b6ac5c
commit
b8e0b6c702
@ -84,6 +84,11 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
|
||||
} else if (buf[i + 1] == SOS) {
|
||||
/* SOS is last marker in the header */
|
||||
i += AV_RB16(&buf[i + 2]) + 2;
|
||||
if (i > size) {
|
||||
av_log(s1, AV_LOG_ERROR,
|
||||
"Insufficient data. Aborted!\n");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user