[FFmpeg-cvslog] r12819 - trunk/libavdevice/vfwcap.c

ramiro subversion
Mon Apr 14 17:07:12 CEST 2008


Author: ramiro
Date: Mon Apr 14 17:07:12 2008
New Revision: 12819

Log:
Simplify more errors by using goto


Modified:
   trunk/libavdevice/vfwcap.c

Modified: trunk/libavdevice/vfwcap.c
==============================================================================
--- trunk/libavdevice/vfwcap.c	(original)
+++ trunk/libavdevice/vfwcap.c	Mon Apr 14 17:07:12 2008
@@ -308,8 +308,7 @@ static int vfw_read_header(AVFormatConte
     }
     ret = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, bisize, (LPARAM) bi);
     if(!ret) {
-        av_free(bi);
-        goto fail_io;
+        goto fail_bi;
     }
 
     dump_bih(s, &bi->bmiHeader);
@@ -322,8 +321,7 @@ static int vfw_read_header(AVFormatConte
     ret = SendMessage(ctx->hwnd, WM_CAP_SET_VIDEOFORMAT, bisize, (LPARAM) bi);
     if(!ret) {
         av_log(s, AV_LOG_ERROR, "Could not set Video Format.\n");
-        av_free(bi);
-        goto fail_io;
+        goto fail_bi;
     }
 
     biCompression = bi->bmiHeader.biCompression;
@@ -392,6 +390,9 @@ static int vfw_read_header(AVFormatConte
 
     return 0;
 
+fail_bi:
+    av_free(bi);
+
 fail_io:
     vfw_read_close(s);
     return AVERROR_IO;




More information about the ffmpeg-cvslog mailing list