h264: prevent an out of array read in decode_nal_units()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ea0ac11e52)
This commit is contained in:
@@ -3672,7 +3672,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
|||||||
s->workaround_bugs |= FF_BUG_TRUNCATED;
|
s->workaround_bugs |= FF_BUG_TRUNCATED;
|
||||||
|
|
||||||
if(!(s->workaround_bugs & FF_BUG_TRUNCATED)){
|
if(!(s->workaround_bugs & FF_BUG_TRUNCATED)){
|
||||||
while(ptr[dst_length - 1] == 0 && dst_length > 0)
|
while(dst_length > 0 && ptr[dst_length - 1] == 0)
|
||||||
dst_length--;
|
dst_length--;
|
||||||
}
|
}
|
||||||
bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1));
|
bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user