[FFmpeg-cvslog] vcr1: check if dimensions are supported, fix out of array accesses.

Michael Niedermayer git at videolan.org
Sat Nov 17 20:50:48 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 17 20:17:22 2012 +0100| [845724c82c1a732ab398c9e8cedd178f96f1626d] | committer: Michael Niedermayer

vcr1: check if dimensions are supported, fix out of array accesses.

Found-by: 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=845724c82c1a732ab398c9e8cedd178f96f1626d
---

 libavcodec/vcr1.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index 2a4a090..acac925 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -50,6 +50,10 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = AV_PIX_FMT_YUV410P;
 
+    if (avctx->width % 8 || avctx->height%4) {
+        av_log_ask_for_sample(avctx, "odd dimensions are not supported\n");
+        return AVERROR_PATCHWELCOME;
+    }
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list