From aa7a5651019a2c603aff2c265777206ef4da742a Mon Sep 17 00:00:00 2001 From: Derek Buitenhuis Date: Fri, 24 Aug 2012 22:10:19 -0400 Subject: [PATCH 1/4] cllc: Pad swapped buffer The bitstream buffer must be padded, or the bitstream reader might read over the end. Fixes the following valgrind warning: Use of uninitialised value of size 8 at 0x591BAE: cllc_decode_frame (cllc.c:166) Signed-off-by: Derek Buitenhuis --- libavcodec/cllc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index a1514179b7..d1beb7efa1 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -284,7 +284,8 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, /* Make sure our bswap16'd buffer is big enough */ swapped_buf_new = av_fast_realloc(ctx->swapped_buf, - &ctx->swapped_buf_size, avpkt->size); + &ctx->swapped_buf_size, avpkt->size + + FF_INPUT_BUFFER_PADDING_SIZE); if (!swapped_buf_new) { av_log(avctx, AV_LOG_ERROR, "Could not realloc swapped buffer.\n"); return AVERROR(ENOMEM); @@ -313,6 +314,10 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, ctx->dsp.bswap16_buf((uint16_t *) ctx->swapped_buf, (uint16_t *) src, (avpkt->size - info_offset) / 2); + /* Initialize padding to 0 */ + memset(ctx->swapped_buf + avpkt->size - info_offset, + 0, FF_INPUT_BUFFER_PADDING_SIZE); + init_get_bits(&gb, ctx->swapped_buf, (avpkt->size - info_offset) * 8); /* From efab2e004a9268dd5f5f88eed20d8cf41627cf2c Mon Sep 17 00:00:00 2001 From: Derek Buitenhuis Date: Thu, 23 Aug 2012 18:17:35 +0000 Subject: [PATCH 2/4] FATE: Add Canopus Lossless tests Signed-off-by: Derek Buitenhuis --- tests/fate/lossless-video.mak | 9 +++++++++ tests/ref/fate/cllc-argb | 5 +++++ tests/ref/fate/cllc-rgb | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/ref/fate/cllc-argb create mode 100644 tests/ref/fate/cllc-rgb diff --git a/tests/fate/lossless-video.mak b/tests/fate/lossless-video.mak index 0a6b544531..5055730b35 100644 --- a/tests/fate/lossless-video.mak +++ b/tests/fate/lossless-video.mak @@ -1,3 +1,12 @@ +FATE_CLLC += fate-cllc-rgb +fate-cllc-rgb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-rgb.avi + +FATE_CLLC += fate-cllc-argb +fate-cllc-argb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-argb.avi + +FATE_SAMPLES_AVCONV += $(FATE_CLLC) +fate-cllc: $(FATE_CLLC) + FATE_LAGARITH += fate-lagarith-rgb24 fate-lagarith-rgb24: CMD = framecrc -i $(SAMPLES)/lagarith/lag-rgb24.avi diff --git a/tests/ref/fate/cllc-argb b/tests/ref/fate/cllc-argb new file mode 100644 index 0000000000..0283863899 --- /dev/null +++ b/tests/ref/fate/cllc-argb @@ -0,0 +1,5 @@ +#tb 0: 1001/24000 +0, 0, 0, 1, 3686400, 0xb37a6e69 +0, 1, 1, 1, 3686400, 0x66a45032 +0, 2, 2, 1, 3686400, 0xdf0c861f +0, 3, 3, 1, 3686400, 0xa4a68cdb diff --git a/tests/ref/fate/cllc-rgb b/tests/ref/fate/cllc-rgb new file mode 100644 index 0000000000..06d54dab5a --- /dev/null +++ b/tests/ref/fate/cllc-rgb @@ -0,0 +1,15 @@ +#tb 0: 1001/30000 +0, 0, 0, 1, 921600, 0x82e44cb9 +0, 1, 1, 1, 921600, 0x6ecc8a6c +0, 2, 2, 1, 921600, 0x0dc31839 +0, 3, 3, 1, 921600, 0x8ed6fb3c +0, 4, 4, 1, 921600, 0x72d759fd +0, 5, 5, 1, 921600, 0x3941e84d +0, 6, 6, 1, 921600, 0x9e63f5cd +0, 7, 7, 1, 921600, 0xbce4f1cc +0, 8, 8, 1, 921600, 0xb531bd5d +0, 9, 9, 1, 921600, 0xab28aada +0, 10, 10, 1, 921600, 0x49f21d52 +0, 11, 11, 1, 921600, 0x4d7488fa +0, 12, 12, 1, 921600, 0x16b9c9c9 +0, 13, 13, 1, 921600, 0xa0a4f77f From cba79d2123bb1626c915cc93a650940b5ebd08b9 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 25 Aug 2012 11:41:13 +0100 Subject: [PATCH 3/4] avconv: remove unused variable opt_shortest This was replaced with a per-file value in 3c0df90. Signed-off-by: Mans Rullgard --- avconv_opt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/avconv_opt.c b/avconv_opt.c index 972453f804..4e483de8ab 100644 --- a/avconv_opt.c +++ b/avconv_opt.c @@ -69,7 +69,6 @@ int do_hex_dump = 0; int do_pkt_dump = 0; int copy_ts = 0; int copy_tb = 1; -int opt_shortest = 0; int exit_on_error = 0; int print_stats = 1; int qp_hist = 0; From db70730291df74595873d41914d2ef398fb13364 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 25 Aug 2012 15:57:19 +0100 Subject: [PATCH 4/4] x86: fft: remove unused fft_dispatch* functions These functions are not used since the yasm conversion. Signed-off-by: Mans Rullgard --- libavcodec/x86/fft_mmx.asm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm index 60d6669238..645253cbd3 100644 --- a/libavcodec/x86/fft_mmx.asm +++ b/libavcodec/x86/fft_mmx.asm @@ -791,14 +791,6 @@ fft %+ n %+ fullsuffix: align 8 dispatch_tab %+ fullsuffix: pointer list_of_fft - -section .text - -; On x86_32, this function does the register saving and restoring for all of fft. -; The others pass args in registers and don't spill anything. -cglobal fft_dispatch%2, 2,5,8, zc, nbits - FFT_DISPATCH fullsuffix, nbits - RET %endmacro ; DECL_FFT %if HAVE_AVX