[FFmpeg-devel] [PATCH 2/4] rawdec: use av_image_check_size

Peter Ross pross at xvid.org
Sun Nov 25 03:20:00 CET 2012


Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavcodec/rawdec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 4d4bce9..f60f5e4 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -175,10 +175,8 @@ static int raw_decode(AVCodecContext *avctx,
         frame->top_field_first  = context->tff;
     }
 
-    if (avctx->width <= 0 || avctx->height <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "w/h is invalid\n");
-        return AVERROR(EINVAL);
-    }
+    if ((res = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
+        return res;
 
     //2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
     if (context->buffer) {
-- 
1.8.0

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121125/02f126b4/attachment.asc>


More information about the ffmpeg-devel mailing list