[FFmpeg-cvslog] avcodec/h264_slice: Fix container cropping
Michael Niedermayer
git at videolan.org
Wed Jul 8 18:01:13 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul 8 17:49:00 2015 +0200| [3c63d06d81e7b4ff8f37c0a3cc344d6a80f72928] | committer: Michael Niedermayer
avcodec/h264_slice: Fix container cropping
Fixes out of array read
Fixes: asan_heap-oob_394322e_138_cov_4265020547_CVPCMNL1_SVA_C.264
Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c63d06d81e7b4ff8f37c0a3cc344d6a80f72928
---
libavcodec/h264_slice.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 4b6c217..10a50bb 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -980,7 +980,10 @@ static int init_dimensions(H264Context *h)
/* handle container cropping */
if (FFALIGN(h->avctx->width, 16) == FFALIGN(width, 16) &&
- FFALIGN(h->avctx->height, 16) == FFALIGN(height, 16)) {
+ FFALIGN(h->avctx->height, 16) == FFALIGN(height, 16) &&
+ h->avctx->width <= width &&
+ h->avctx->height <= height
+ ) {
width = h->avctx->width;
height = h->avctx->height;
}
More information about the ffmpeg-cvslog
mailing list