== FFMPEG ==
authorPeter Schlaile <peter@schlaile.de>
Sun, 3 Aug 2008 16:11:57 +0000 (16:11 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 3 Aug 2008 16:11:57 +0000 (16:11 +0000)
This fixes:
[#16655] Blender crashes when Fraps videos are added to the sequencer

(sorry, color conversion is not supported by swscaler for some reason,
so currently, only the crash is fixed)

source/blender/imbuf/intern/anim.c

index 720f5b0f7c8d0bc967424642274a1af88d33c5fd..c0e84b73e47bb64c5bef4e24c5a047420dde12da 100644 (file)
@@ -612,6 +612,7 @@ static int startffmpeg(struct anim * anim) {
                av_free(anim->pFrameRGB);
                av_free(anim->pFrameDeinterlaced);
                av_free(anim->pFrame);
+               anim->pCodecCtx = NULL;
                return -1;
        }
 
@@ -639,7 +640,19 @@ static int startffmpeg(struct anim * anim) {
                PIX_FMT_BGR32,
                SWS_FAST_BILINEAR | SWS_PRINT_INFO,
                NULL, NULL, NULL);
-                               
+               
+       if (!anim->img_convert_ctx) {
+               fprintf (stderr,
+                        "Can't transform color space??? Bailing out...\n");
+               avcodec_close(anim->pCodecCtx);
+               av_close_input_file(anim->pFormatCtx);
+               av_free(anim->pFrameRGB);
+               av_free(anim->pFrameDeinterlaced);
+               av_free(anim->pFrame);
+               anim->pCodecCtx = NULL;
+               return -1;
+       }
+               
        return (0);
 }