diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2008-04-14 15:07:12 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2008-04-14 15:07:12 +0000 |
commit | e110f48608f2ce3d9dca05e7bfc414bd8da02043 (patch) | |
tree | e84e47c3337628533c58acab2a1b0139cc859976 /libavdevice | |
parent | 76c2662b48b544f47aebc8afcfddfee4ec99d138 (diff) | |
download | ffmpeg-e110f48608f2ce3d9dca05e7bfc414bd8da02043.tar.gz |
Simplify more errors by using goto
Originally committed as revision 12819 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/vfwcap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index ababab9c84..1ab5548cef 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -308,8 +308,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) } 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(AVFormatContext *s, AVFormatParameters *ap) 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(AVFormatContext *s, AVFormatParameters *ap) return 0; +fail_bi: + av_free(bi); + fail_io: vfw_read_close(s); return AVERROR_IO; |