From 6c071a2b389578b0607b4d4356520a43fac4b3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 5 Aug 2012 22:55:21 +0300 Subject: [PATCH 1/9] lavf: Declare an AVRational struct without a struct literal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At this place, the normal way of initializing a struct works fine, there's no need for a struct literal. Signed-off-by: Martin Storsjö --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 3630c6f93f..5b26c59bc6 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2499,7 +2499,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) /* round guessed framerate to a "standard" framerate if it's * within 1% of the original estimate*/ for (j = 1; j < MAX_STD_TIMEBASES; j++) { - AVRational std_fps = (AVRational){get_std_framerate(j), 12*1001}; + AVRational std_fps = { get_std_framerate(j), 12*1001 }; double error = fabs(av_q2d(st->avg_frame_rate) / av_q2d(std_fps) - 1); if (error < best_error) { From add8f5eab7e3e02e26f3e5c1714c7062f3c45d89 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Aug 2012 12:06:19 +0100 Subject: [PATCH 2/9] fate: simplify variable setting filter.mak This removes some needless indirection and duplication. Signed-off-by: Mans Rullgard --- tests/fate/filter.mak | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/fate/filter.mak b/tests/fate/filter.mak index 35b65588c8..e42f837bb3 100644 --- a/tests/fate/filter.mak +++ b/tests/fate/filter.mak @@ -19,21 +19,16 @@ $(FATE_AMIX): CMP = oneoff $(FATE_AMIX): CMP_UNIT = f32 FATE_FILTER += $(FATE_AMIX) -FATE_SAMPLES_AVCONV += $(FATE_AMIX) -FATE_ASYNCTS += fate-filter-asyncts +FATE_FILTER += fate-filter-asyncts fate-filter-asyncts: SRC = $(SAMPLES)/nellymoser/nellymoser-discont.flv fate-filter-asyncts: CMD = pcm -analyzeduration 10000000 -i $(SRC) -af asyncts fate-filter-asyncts: CMP = oneoff fate-filter-asyncts: REF = $(SAMPLES)/nellymoser/nellymoser-discont.pcm -FATE_FILTER += $(FATE_ASYNCTS) -FATE_SAMPLES_AVCONV += $(FATE_ASYNCTS) - fate-filter-delogo: CMD = framecrc -i $(SAMPLES)/real/rv30.rm -vf delogo=show=0:x=290:y=25:w=26:h=16 -an FATE_FILTER += fate-filter-delogo -FATE_SAMPLES_AVCONV += fate-filter-delogo FATE_YADIF += fate-filter-yadif-mode0 fate-filter-yadif-mode0: CMD = framecrc -flags bitexact -idct simple -i $(SAMPLES)/mpeg2/mpeg2_field_encoding.ts -vf yadif=0 @@ -42,6 +37,6 @@ FATE_YADIF += fate-filter-yadif-mode1 fate-filter-yadif-mode1: CMD = framecrc -flags bitexact -idct simple -i $(SAMPLES)/mpeg2/mpeg2_field_encoding.ts -vf yadif=1 FATE_FILTER += $(FATE_YADIF) -FATE_SAMPLES_AVCONV += $(FATE_YADIF) +FATE_SAMPLES_AVCONV += $(FATE_FILTER) fate-filter: $(FATE_FILTER) From 2b6804328e24dde539ada027fada8bfb70eedcf8 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Aug 2012 18:32:03 +0100 Subject: [PATCH 3/9] imc: remove empty if() block Signed-off-by: Mans Rullgard --- libavcodec/imc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 6df3e581d7..297efbb5c7 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -229,9 +229,6 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) } q->one_div_log2 = 1 / log(2); - if (avctx->codec_id == CODEC_ID_IAC) { - } - if (avctx->codec_id == CODEC_ID_IAC) { iac_generate_tabs(q, avctx->sample_rate); } else { From bc90230b98e5194fd5bb629a409a50a3ec3b648b Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Aug 2012 22:32:20 +0100 Subject: [PATCH 4/9] imc: fix size of a memset() IMCContext was changed from an array to a pointer in 66b84e4, but this memset() was not updated. Signed-off-by: Mans Rullgard --- libavcodec/imc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 297efbb5c7..8ee8e72fec 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -789,7 +789,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch) chctx->decoder_reset = 1; if (chctx->decoder_reset) { - memset(q->out_samples, 0, sizeof(q->out_samples)); + memset(q->out_samples, 0, COEFFS * sizeof(*q->out_samples)); for (i = 0; i < BANDS; i++) chctx->old_floor[i] = 1.0; for (i = 0; i < COEFFS; i++) From b40ea0f41d35b9c65eafc7f63e0e9e54b6a12f26 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 5 Aug 2012 22:36:09 +0100 Subject: [PATCH 5/9] imc: remove unused field IMCContext.one_div_log2 Signed-off-by: Mans Rullgard --- libavcodec/imc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 8ee8e72fec..3ae8cc927d 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -92,7 +92,6 @@ typedef struct { float sqrt_tab[30]; GetBitContext gb; - float one_div_log2; DSPContext dsp; FFTContext fft; @@ -227,7 +226,6 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) imc_huffman_bits[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC); } } - q->one_div_log2 = 1 / log(2); if (avctx->codec_id == CODEC_ID_IAC) { iac_generate_tabs(q, avctx->sample_rate); From 110d015ad450ea1b2fd40f0e9ce1c53507cdec5d Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Mon, 6 Aug 2012 13:50:51 +0200 Subject: [PATCH 6/9] Revert "nuv: check per-frame header for validity." The check is bogus since the nuv frameheader is already skipped and the (decompressed) RTjpeg header is checked. This reverts commit f6afacdb3b708720c9fb85984b4f7fdbca2b2036. CC: libav-stable@libav.org --- libavcodec/nuv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 534fd03567..2e01602db7 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -184,9 +184,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } if (c->codec_frameheader) { int w, h, q; - if (buf[0] != 'V' || buf_size < 12) { - av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n"); - return AVERROR_INVALIDDATA; + if (buf_size < 12) { + av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n"); + return -1; } w = AV_RL16(&buf[6]); h = AV_RL16(&buf[8]); From 859a579e9bbf47fae2e09494c43bcf813dcb2fad Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Mon, 6 Aug 2012 13:59:04 +0200 Subject: [PATCH 7/9] nuv: check RTjpeg header for validity CC: libav-stable@libav.org --- libavcodec/nuv.c | 9 +++++---- libavcodec/rtjpeg.h | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 2e01602db7..4cb9b951a1 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -184,17 +184,18 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } if (c->codec_frameheader) { int w, h, q; - if (buf_size < 12) { + if (buf_size < RTJPEG_HEADER_SIZE || buf[4] != RTJPEG_HEADER_SIZE || + buf[5] != RTJPEG_FILE_VERSION) { av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n"); - return -1; + return AVERROR_INVALIDDATA; } w = AV_RL16(&buf[6]); h = AV_RL16(&buf[8]); q = buf[10]; if (!codec_reinit(avctx, w, h, q)) return -1; - buf = &buf[12]; - buf_size -= 12; + buf = &buf[RTJPEG_HEADER_SIZE]; + buf_size -= RTJPEG_HEADER_SIZE; } if (keyframe && c->pic.data[0]) diff --git a/libavcodec/rtjpeg.h b/libavcodec/rtjpeg.h index 95b59e9c75..d1598954df 100644 --- a/libavcodec/rtjpeg.h +++ b/libavcodec/rtjpeg.h @@ -25,6 +25,9 @@ #include #include "dsputil.h" +#define RTJPEG_FILE_VERSION 0 +#define RTJPEG_HEADER_SIZE 12 + typedef struct { int w, h; DSPContext *dsp; From baac24e6807aee799e39a1a4bce6dfe59c858137 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 4 Aug 2012 19:04:08 +0100 Subject: [PATCH 8/9] build: generalise rules and variable settings for av* programs This simplifies adding extra flags for individual programs and also allows more than one object file per program. Signed-off-by: Mans Rullgard --- Makefile | 17 ++++++++++++----- configure | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e9580d2164..644aff42c8 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ PROGS-$(CONFIG_AVPROBE) += avprobe PROGS-$(CONFIG_AVSERVER) += avserver PROGS := $(PROGS-yes:%=%$(EXESUF)) -OBJS = $(PROGS-yes:%=%.o) cmdutils.o +OBJS = cmdutils.o TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options TOOLS = qt-faststart trasher @@ -121,12 +121,19 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) -avplay.o: CFLAGS += $(SDL_CFLAGS) -avplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) -avserver$(EXESUF): LDFLAGS += $(AVSERVERLDFLAGS) +define DOPROG +OBJS-$(1) += $(1).o +$(1)$(EXESUF): $(OBJS-$(1)) +$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) +$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) +$(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1)) +-include $$(OBJS-$(1):.o=.d) +endef + +$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P)))) $(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) - $(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS) + $(LD) $(LDFLAGS) -o $@ $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS) OBJDIRS += tools diff --git a/configure b/configure index b139008d2b..805f33e4f5 100755 --- a/configure +++ b/configure @@ -3442,7 +3442,7 @@ CC_O=$CC_O LD_O=$LD_O DLLTOOL=$dlltool LDFLAGS=$LDFLAGS -AVSERVERLDFLAGS=$AVSERVERLDFLAGS +LDFLAGS-avserver=$AVSERVERLDFLAGS SHFLAGS=$SHFLAGS YASMFLAGS=$YASMFLAGS BUILDSUF=$build_suffix @@ -3474,8 +3474,8 @@ HOSTCC_C=$HOSTCC_C HOSTCC_O=$HOSTCC_O TARGET_EXEC=$target_exec TARGET_PATH=$target_path -SDL_LIBS=$sdl_libs -SDL_CFLAGS=$sdl_cflags +LIBS-avplay=$sdl_libs +CFLAGS-avplay=$sdl_cflags LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD EXTRALIBS=$extralibs INSTALL=install From cf22705e87b6f5015b5cbbf60b6ce9b818eb1900 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 6 Aug 2012 15:49:51 +0200 Subject: [PATCH 9/9] nuv: K&R formatting cosmetics --- libavcodec/nuv.c | 166 +++++++++++++++++++++++++++-------------------- 1 file changed, 96 insertions(+), 70 deletions(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 4cb9b951a1..50bbcd7fc6 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -18,6 +18,7 @@ * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + #include #include @@ -34,7 +35,7 @@ typedef struct { int quality; int width, height; unsigned int decomp_size; - unsigned char* decomp_buf; + unsigned char *decomp_buf; uint32_t lq[64], cq[64]; RTJpegContext rtj; DSPContext dsp; @@ -69,8 +70,8 @@ static const uint8_t fallback_cquant[] = { * @param width width of the video frame * @param height height of the video frame */ -static void copy_frame(AVFrame *f, const uint8_t *src, - int width, int height) { +static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height) +{ AVPicture pic; avpicture_fill(&pic, src, PIX_FMT_YUV420P, width, height); av_picture_copy((AVPicture *)f, &pic, PIX_FMT_YUV420P, width, height); @@ -79,8 +80,9 @@ static void copy_frame(AVFrame *f, const uint8_t *src, /** * @brief extract quantization tables from codec data into our context */ -static int get_quant(AVCodecContext *avctx, NuvContext *c, - const uint8_t *buf, int size) { +static int get_quant(AVCodecContext *avctx, NuvContext *c, const uint8_t *buf, + int size) +{ int i; if (size < 2 * 64 * 4) { av_log(avctx, AV_LOG_ERROR, "insufficient rtjpeg quant data\n"); @@ -96,7 +98,8 @@ static int get_quant(AVCodecContext *avctx, NuvContext *c, /** * @brief set quantization tables from a quality value */ -static void get_quant_quality(NuvContext *c, int quality) { +static void get_quant_quality(NuvContext *c, int quality) +{ int i; quality = FFMAX(quality, 1); for (i = 0; i < 64; i++) { @@ -105,7 +108,9 @@ static void get_quant_quality(NuvContext *c, int quality) { } } -static int codec_reinit(AVCodecContext *avctx, int width, int height, int quality) { +static int codec_reinit(AVCodecContext *avctx, int width, int height, + int quality) +{ NuvContext *c = avctx->priv_data; width = FFALIGN(width, 2); height = FFALIGN(height, 2); @@ -114,31 +119,42 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit if (width != c->width || height != c->height) { if (av_image_check_size(height, width, 0, avctx) < 0) return 0; - avctx->width = c->width = width; + avctx->width = c->width = width; avctx->height = c->height = height; - av_fast_malloc(&c->decomp_buf, &c->decomp_size, c->height * c->width * 3 / 2); + av_fast_malloc(&c->decomp_buf, &c->decomp_size, + c->height * c->width * 3 / 2); if (!c->decomp_buf) { - av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); + av_log(avctx, AV_LOG_ERROR, + "Can't allocate decompression buffer.\n"); return 0; } - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, + c->lq, c->cq); } else if (quality != c->quality) - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, + c->lq, c->cq); + return 1; } static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - AVPacket *avpkt) { + AVPacket *avpkt) +{ const uint8_t *buf = avpkt->data; - int buf_size = avpkt->size; - NuvContext *c = avctx->priv_data; - AVFrame *picture = data; - int orig_size = buf_size; + int buf_size = avpkt->size; + NuvContext *c = avctx->priv_data; + AVFrame *picture = data; + int orig_size = buf_size; int keyframe; int result; - enum {NUV_UNCOMPRESSED = '0', NUV_RTJPEG = '1', - NUV_RTJPEG_IN_LZO = '2', NUV_LZO = '3', - NUV_BLACK = 'N', NUV_COPY_LAST = 'L'} comptype; + enum { + NUV_UNCOMPRESSED = '0', + NUV_RTJPEG = '1', + NUV_RTJPEG_IN_LZO = '2', + NUV_LZO = '3', + NUV_BLACK = 'N', + NUV_COPY_LAST = 'L' + } comptype; if (buf_size < 12) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); @@ -149,12 +165,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (buf[0] == 'D' && buf[1] == 'R') { int ret; // skip rest of the frameheader. - buf = &buf[12]; + buf = &buf[12]; buf_size -= 12; - ret = get_quant(avctx, c, buf, buf_size); + ret = get_quant(avctx, c, buf, buf_size); if (ret < 0) return ret; - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, + c->cq); return orig_size; } @@ -164,22 +181,25 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } comptype = buf[1]; switch (comptype) { - case NUV_RTJPEG_IN_LZO: - case NUV_RTJPEG: - keyframe = !buf[2]; break; - case NUV_COPY_LAST: - keyframe = 0; break; - default: - keyframe = 1; break; + case NUV_RTJPEG_IN_LZO: + case NUV_RTJPEG: + keyframe = !buf[2]; + break; + case NUV_COPY_LAST: + keyframe = 0; + break; + default: + keyframe = 1; + break; } // skip rest of the frameheader. - buf = &buf[12]; + buf = &buf[12]; buf_size -= 12; if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) { int outlen = c->decomp_size, inlen = buf_size; if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen)) av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); - buf = c->decomp_buf; + buf = c->decomp_buf; buf_size = c->decomp_size; } if (c->codec_frameheader) { @@ -194,14 +214,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, q = buf[10]; if (!codec_reinit(avctx, w, h, q)) return -1; - buf = &buf[RTJPEG_HEADER_SIZE]; + buf = &buf[RTJPEG_HEADER_SIZE]; buf_size -= RTJPEG_HEADER_SIZE; } if (keyframe && c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); - c->pic.reference = 3; - c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE | + c->pic.reference = 3; + c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; result = avctx->reget_buffer(avctx, &c->pic); if (result < 0) { @@ -213,63 +233,69 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, c->pic.key_frame = keyframe; // decompress/copy/whatever data switch (comptype) { - case NUV_LZO: - case NUV_UNCOMPRESSED: { - int height = c->height; - if (buf_size < c->width * height * 3 / 2) { - av_log(avctx, AV_LOG_ERROR, "uncompressed frame too short\n"); - height = buf_size / c->width / 3 * 2; - } - copy_frame(&c->pic, buf, c->width, height); - break; + case NUV_LZO: + case NUV_UNCOMPRESSED: { + int height = c->height; + if (buf_size < c->width * height * 3 / 2) { + av_log(avctx, AV_LOG_ERROR, "uncompressed frame too short\n"); + height = buf_size / c->width / 3 * 2; } - case NUV_RTJPEG_IN_LZO: - case NUV_RTJPEG: { - ff_rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size); - break; - } - case NUV_BLACK: { - memset(c->pic.data[0], 0, c->width * c->height); - memset(c->pic.data[1], 128, c->width * c->height / 4); - memset(c->pic.data[2], 128, c->width * c->height / 4); - break; - } - case NUV_COPY_LAST: { - /* nothing more to do here */ - break; - } - default: - av_log(avctx, AV_LOG_ERROR, "unknown compression\n"); - return -1; + copy_frame(&c->pic, buf, c->width, height); + break; + } + case NUV_RTJPEG_IN_LZO: + case NUV_RTJPEG: + ff_rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size); + break; + case NUV_BLACK: + memset(c->pic.data[0], 0, c->width * c->height); + memset(c->pic.data[1], 128, c->width * c->height / 4); + memset(c->pic.data[2], 128, c->width * c->height / 4); + break; + case NUV_COPY_LAST: + /* nothing more to do here */ + break; + default: + av_log(avctx, AV_LOG_ERROR, "unknown compression\n"); + return -1; } - *picture = c->pic; + *picture = c->pic; *data_size = sizeof(AVFrame); return orig_size; } -static av_cold int decode_init(AVCodecContext *avctx) { - NuvContext *c = avctx->priv_data; +static av_cold int decode_init(AVCodecContext *avctx) +{ + NuvContext *c = avctx->priv_data; avctx->pix_fmt = PIX_FMT_YUV420P; c->pic.data[0] = NULL; - c->decomp_buf = NULL; - c->quality = -1; - c->width = 0; - c->height = 0; + c->decomp_buf = NULL; + c->quality = -1; + c->width = 0; + c->height = 0; + c->codec_frameheader = avctx->codec_tag == MKTAG('R', 'J', 'P', 'G'); + if (avctx->extradata_size) get_quant(avctx, c, avctx->extradata, avctx->extradata_size); + ff_dsputil_init(&c->dsp, avctx); + if (!codec_reinit(avctx, avctx->width, avctx->height, -1)) return 1; + return 0; } -static av_cold int decode_end(AVCodecContext *avctx) { +static av_cold int decode_end(AVCodecContext *avctx) +{ NuvContext *c = avctx->priv_data; + av_freep(&c->decomp_buf); if (c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); + return 0; }