OSDN Git Service

ffmpeg: check avpicture_get_size() retuen value
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 22 Oct 2012 22:22:23 +0000 (00:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 22 Oct 2012 22:22:23 +0000 (00:22 +0200)
Fixes CID205018
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 46e128a..a0e41bd 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -664,6 +664,8 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
 
         /* create temporary picture */
         size = avpicture_get_size(dec->pix_fmt, dec->width, dec->height);
+        if (size < 0)
+            return;
         buf  = av_malloc(size);
         if (!buf)
             return;