Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-17 04:36:26 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-11-17 04:38:41 +0400
commit9f890a165666a73376c73b3c2bd920345b5c3b79 (patch)
treec458e2bc9350fd0be13b249b63bd319330870e0f /libavcodec/iff.c
parent10ac6f3ce9ae4065a5b72ddfaded45f75b357518 (diff)
parent2e09096da912f563c4dd889a8f25c314529bbaa6 (diff)
Merge commit '2e09096da912f563c4dd889a8f25c314529bbaa6'
* commit '2e09096da912f563c4dd889a8f25c314529bbaa6': kgv1: use the AVFrame API properly. indeo2: use the AVFrame API properly. iff: use the AVFrame API properly. msrle: use the AVFrame API properly. Conflicts: libavcodec/iff.c libavcodec/indeo2.c libavcodec/kgv1dec.c libavcodec/msrle.c See: 451b2ca1b4349f9b60416cc057eaf5518d81025c See: 80e9e63c946660304fc65fa8141ccfdbe4d196d1 See: 057dce5f21cd70db1ef6e3b67644a39f0d51aba5 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index a4b90fa4a3..5d69539171 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -318,6 +318,16 @@ static int extract_header(AVCodecContext *const avctx,
return 0;
}
+static av_cold int decode_end(AVCodecContext *avctx)
+{
+ IffContext *s = avctx->priv_data;
+ av_frame_free(&s->frame);
+ av_freep(&s->planebuf);
+ av_freep(&s->ham_buf);
+ av_freep(&s->ham_palbuf);
+ return 0;
+}
+
static av_cold int decode_init(AVCodecContext *avctx)
{
IffContext *s = avctx->priv_data;
@@ -360,8 +370,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->bpp = avctx->bits_per_coded_sample;
s->frame = av_frame_alloc();
- if (!s->frame)
+ if (!s->frame) {
+ decode_end(avctx);
return AVERROR(ENOMEM);
+ }
if ((err = extract_header(avctx, NULL)) < 0)
return err;
@@ -858,16 +870,6 @@ static int decode_frame(AVCodecContext *avctx,
return buf_size;
}
-static av_cold int decode_end(AVCodecContext *avctx)
-{
- IffContext *s = avctx->priv_data;
- av_frame_free(&s->frame);
- av_freep(&s->planebuf);
- av_freep(&s->ham_buf);
- av_freep(&s->ham_palbuf);
- return 0;
-}
-
#if CONFIG_IFF_ILBM_DECODER
AVCodec ff_iff_ilbm_decoder = {
.name = "iff",