aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2013-05-31 22:36:47 +0200
committerReinhard Tartler <siretart@tauware.de>2013-06-22 08:40:00 +0200
commitca4a25acf89b715f8f587c947be7145d637a67d1 (patch)
tree9618097c2ddf8405d3f1525fdb62bc381e578d7b /libavcodec
parent2ebabfff4804c75b5212ae264a5f6005e417484c (diff)
downloadffmpeg-ca4a25acf89b715f8f587c947be7145d637a67d1.tar.gz
jpegls: factorize return paths
Conflicts: libavcodec/jpeglsdec.c (cherry picked from commit 4a4107b48944397c914aa39ee16a82fe44db8c4c)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/jpeglsdec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index ca0224c906..63bf5cff87 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -260,7 +260,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
int i, t = 0;
uint8_t *zero, *last, *cur;
JLSState *state;
- int off = 0, stride = 1, width, shift;
+ int off = 0, stride = 1, width, shift, ret = 0;
zero = av_mallocz(s->picture_ptr->linesize[0]);
last = zero;
@@ -326,9 +326,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
}
} else if (ilv == 2) { /* sample interleaving */
av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
- av_free(state);
- av_free(zero);
- return AVERROR_PATCHWELCOME;
+ ret = AVERROR_PATCHWELCOME;
+ goto end;
}
if(shift){ /* we need to do point transform or normalize samples */
@@ -356,10 +355,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
}
}
}
+
+end:
av_free(state);
av_free(zero);
- return 0;
+ return ret;
}