Bugfix: isffmpeg() could access a pointer array using an index of -1,
authorKen Hughes <khughes@pacific.edu>
Thu, 30 Mar 2006 21:51:59 +0000 (21:51 +0000)
committerKen Hughes <khughes@pacific.edu>
Thu, 30 Mar 2006 21:51:59 +0000 (21:51 +0000)
causing a segfault.

source/blender/imbuf/intern/util.c

index d741665f6ead287cfb2719ce0fba3f10fe2d768e..38a9a2d7b508f265a2eef6771e7ed57211f97656 100644 (file)
@@ -266,14 +266,10 @@ static int isffmpeg (char *filename) {
                        break;
                }
 
-       pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]);
-
-       if(videoStream==-1) {
-               avcodec_close(pCodecCtx);
-               av_close_input_file(pFormatCtx);
+       if(videoStream==-1)
                return 0;
-       }
 
+       pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]);
 
         /* Find the decoder for the video stream */
        pCodec=avcodec_find_decoder(pCodecCtx->codec_id);