diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 04:23:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 05:35:10 +0200 |
commit | f3296b945464b41aa067949b24dfcfeb0db9d875 (patch) | |
tree | 81ce3abde44119df8acd45c58af359178cc95835 | |
parent | 344f8d307ac766c812b4c33331235e8ac9120a9f (diff) | |
download | ffmpeg-f3296b945464b41aa067949b24dfcfeb0db9d875.tar.gz |
avcodec/h264: Undefined behavior (left shift of 12852653 by 8 places cannot be represented in type 'int')
Fixes: asan_heap-oob_84f75d_8_asan_heap-oob_a2a00a_341_mbc.ts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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 c4f4b052ff..0405779284 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1358,7 +1358,7 @@ static int get_avc_nalsize(H264Context *h, const uint8_t *buf, return -1; for (i = 0; i < h->nal_length_size; i++) - nalsize = (nalsize << 8) | buf[(*buf_index)++]; + nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++]; if (nalsize <= 0 || nalsize > buf_size - *buf_index) { av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); |