[FFmpeg-cvslog] avcodec/012v: Check dimensions more completely

Michael Niedermayer git at videolan.org
Sat Mar 21 02:30:15 CET 2015


ffmpeg | branch: release/2.5 | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 10 20:21:14 2015 +0100| [2b408d257fed340eb7b27aa25dd1b7bc6eb38a4f] | committer: Michael Niedermayer

avcodec/012v: Check dimensions more completely

Fixes division by 0

Found-by: Thomas Lindroth <thomas.lindroth at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b408d257fed340eb7b27aa25dd1b7bc6eb38a4f
---

 libavcodec/012v.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index c2b6a35..7526e8f 100644
--- a/libavcodec/012v.c
+++ b/libavcodec/012v.c
@@ -45,8 +45,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
     const uint8_t *line_end, *src = avpkt->data;
     int stride = avctx->width * 8 / 3;
 
-    if (width == 1) {
-        av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
+    if (width <= 1 || avctx->height <= 0) {
+        av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
         return AVERROR_INVALIDDATA;
     }
 



More information about the ffmpeg-cvslog mailing list