summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_sei.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-21 16:38:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-21 17:57:15 +0200
commit45da7a0e8f271b32202424358393aa249a939028 (patch)
tree65d12417fa4d84b2c3f52df8de11b5d999ef35be /libavcodec/h264_sei.c
parent80c873a87ed07c6dd772dcf6befb4cf0fd98ef7b (diff)
downloadffmpeg-streaming-45da7a0e8f271b32202424358393aa249a939028.zip
ffmpeg-streaming-45da7a0e8f271b32202424358393aa249a939028.tar.gz
avcodec/ff_h264_decode_sei: Check SEI size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_sei.c')
-rw-r--r--libavcodec/h264_sei.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 3003080..5e4321f 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -264,6 +264,11 @@ int ff_h264_decode_sei(H264Context *h){
if(h->avctx->debug&FF_DEBUG_STARTCODE)
av_log(h->avctx, AV_LOG_DEBUG, "SEI %d len:%d\n", type, size);
+ if (size > get_bits_left(&h->gb) / 8) {
+ av_log(h->avctx, AV_LOG_ERROR, "SEI truncated\n");
+ return AVERROR_INVALIDDATA;
+ }
+
switch(type){
case SEI_TYPE_PIC_TIMING: // Picture timing SEI
if(decode_picture_timing(h) < 0)
OpenPOWER on IntegriCloud