Browse Source

fix some crashes on negative nalsize.

Originally committed as revision 5022 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Loren Merritt 19 years ago
parent
commit
8b03135958
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      libavcodec/h264.c

+ 9
- 0
libavcodec/h264.c View File

@@ -7507,6 +7507,15 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
nalsize = 0;
for(i = 0; i < h->nal_length_size; i++)
nalsize = (nalsize << 8) | buf[buf_index++];
if(nalsize <= 1){
if(nalsize == 1){
buf_index++;
continue;
}else{
av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
break;
}
}
} else {
// start code prefix search
for(; buf_index + 3 < buf_size; buf_index++){


Loading…
Cancel
Save