summaryrefslogtreecommitdiff
path: root/libavcodec/xan.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-17 02:09:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-17 02:12:51 +0100
commit8af7774c7aca6f3b595d0417b92f543ce0c7b537 (patch)
tree32551417d79c0bf387eeb3e3d9e214d5d3c8ac36 /libavcodec/xan.c
parentfe3808eddee81ce4712d1e729fa6fe619f1685c8 (diff)
parent3c8ea9d4a74fd4d7493d40c818ca64ee492709f3 (diff)
Merge commit '3c8ea9d4a74fd4d7493d40c818ca64ee492709f3'
* commit '3c8ea9d4a74fd4d7493d40c818ca64ee492709f3': vmnc: use the AVFrame API properly. xan: use the AVFrame API properly. xxan: use the AVFrame API properly. zerocodec: use the AVFrame API properly. Conflicts: libavcodec/vmnc.c libavcodec/xan.c libavcodec/xxan.c See: cf5ab8b6f71699a48a6384d5e5779630b4be7b56 See: ad438f450b83882a1277a79c1c3d6dfe55573b1c See: 67607e20e882eb5639a4e9099caecb52a863ab68 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 33bc0b068f..7489113cf7 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -71,7 +71,18 @@ typedef struct XanContext {
} XanContext;
-static av_cold int xan_decode_end(AVCodecContext *avctx);
+static av_cold int xan_decode_end(AVCodecContext *avctx)
+{
+ XanContext *s = avctx->priv_data;
+
+ av_frame_free(&s->last_frame);
+
+ av_freep(&s->buffer1);
+ av_freep(&s->buffer2);
+ av_freep(&s->palettes);
+
+ return 0;
+}
static av_cold int xan_decode_init(AVCodecContext *avctx)
{
@@ -92,6 +103,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
av_freep(&s->buffer1);
return AVERROR(ENOMEM);
}
+
s->last_frame = av_frame_alloc();
if (!s->last_frame) {
xan_decode_end(avctx);
@@ -623,19 +635,6 @@ static int xan_decode_frame(AVCodecContext *avctx,
return buf_size;
}
-static av_cold int xan_decode_end(AVCodecContext *avctx)
-{
- XanContext *s = avctx->priv_data;
-
- av_frame_free(&s->last_frame);
-
- av_freep(&s->buffer1);
- av_freep(&s->buffer2);
- av_freep(&s->palettes);
-
- return 0;
-}
-
AVCodec ff_xan_wc3_decoder = {
.name = "xan_wc3",
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"),