Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avcodec/ff_h264_decode_sei: Check SEI size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Jul 21, 2013
1 parent 80c873a commit 45da7a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavcodec/h264_sei.c
Expand Up @@ -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)
Expand Down

0 comments on commit 45da7a0

Please sign in to comment.