diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-11 07:23:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-21 18:02:18 +0200 |
commit | 54544100a3ad24a81275f013f278e7f41f1229f7 (patch) | |
tree | e508e2e4b10fe52b5e7837c6c49749869cf2ad8f | |
parent | 97437dada65833d09604c40f01c874a676de3c32 (diff) | |
download | ffmpeg-54544100a3ad24a81275f013f278e7f41f1229f7.tar.gz |
h264: prevent an out of array read in decode_nal_units()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ea0ac11e52b9cf5264f3d4eb7543e760c2a5fbb4)
-rw-r--r-- | libavcodec/h264.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index ee2c6a31a0..12bed3a919 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3672,7 +3672,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ 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--; } bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1)); |