vd_ffmpeg: check for malloc failure.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 21 Jul 2016 21:54:11 +0000 (21:54 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 21 Jul 2016 21:54:11 +0000 (21:54 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37880 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpcodecs/vd_ffmpeg.c

index b1512d4..6ac890d 100644 (file)
@@ -476,6 +476,10 @@ static int init(sh_video_t *sh){
             break;
         avctx->extradata_size = sh->bih->biSize-sizeof(*sh->bih);
         avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+        if (!avctx->extradata) {
+            avctx->extradata_size = 0;
+            break;
+        }
         memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size);
         break;
     }