Commit 6ea04a4e authored by reimar's avatar reimar

Fix nalsize check to avoid an integer overflow that made the check

incorrect for nalsize >= INT_MAX


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19307 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 834d32f9
......@@ -7505,7 +7505,7 @@ static int decode_nal_units(H264Context *h, const 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 || (nalsize+buf_index > buf_size)){
if(nalsize <= 1 || nalsize > buf_size - buf_index){
if(nalsize == 1){
buf_index++;
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment