From b25e49b187617c486ae3f50a5cbb356fc0e868bb Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 14 May 2013 15:27:26 +0200 Subject: mjpegdec: properly report unsupported disabled features When JPEG-LS support is disabled the decoder would feed the data to the JPEG Lossless decode_*_scan function resulting in faulty decoding. CC: libav-stable@libav.org --- libavcodec/mjpegdec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavcodec') diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 61ebabc77d..ef46c5f2a2 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1485,6 +1485,12 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, else if (start_code == COM) mjpeg_decode_com(s); + if (!CONFIG_JPEGLS_DECODER && + (start_code == SOF48 || start_code == LSE)) { + av_log(avctx, AV_LOG_ERROR, "JPEG-LS support not enabled.\n"); + return AVERROR(ENOSYS); + } + switch (start_code) { case SOI: s->restart_interval = 0; -- cgit v1.2.3 From 39cc4c61de719345a6bf801285339428c768cd5d Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 15 May 2013 18:16:18 +0200 Subject: flacdec: drop unnecessary assert The condition cannot happen anymore. --- libavcodec/flacdec.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index ec54dfc292..919a6925b4 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -44,9 +44,6 @@ #include "flacdata.h" #include "flacdsp.h" -#undef NDEBUG -#include - typedef struct FLACContext { FLACSTREAMINFO @@ -130,8 +127,6 @@ static int allocate_buffers(FLACContext *s) { int buf_size; - assert(s->max_blocksize); - buf_size = av_samples_get_buffer_size(NULL, s->channels, s->max_blocksize, AV_SAMPLE_FMT_S32P, 0); if (buf_size < 0) -- cgit v1.2.3 From 4dbceaa3a84c577e9d79f8c440ee7c223ac917d6 Mon Sep 17 00:00:00 2001 From: Michael Kostylev Date: Tue, 14 May 2013 20:25:30 -0400 Subject: sparc: Eliminate dead code in VIS acceleration macros Signed-off-by: Diego Biurrun --- libavcodec/sparc/vis.h | 58 -------------------------------------------------- 1 file changed, 58 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/sparc/vis.h b/libavcodec/sparc/vis.h index 04b70c3838..30dc166899 100644 --- a/libavcodec/sparc/vis.h +++ b/libavcodec/sparc/vis.h @@ -173,32 +173,6 @@ static inline void vis_set_gsr(unsigned int _val) #define vis_st64(rs1,mem) vis_r2m(std, rs1, mem) #define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2) -#define vis_ldblk(mem, rd) \ -do { register void *__mem __asm__("g1"); \ - __mem = &(mem); \ - __asm__ volatile(".word 0xc1985e00 | %1" \ - : \ - : "r" (__mem), \ - "i" (vis_rd_d(rd)) \ - : "memory"); \ -} while (0) - -#define vis_stblk(rd, mem) \ -do { register void *__mem __asm__("g1"); \ - __mem = &(mem); \ - __asm__ volatile(".word 0xc1b85e00 | %1" \ - : \ - : "r" (__mem), \ - "i" (vis_rd_d(rd)) \ - : "memory"); \ -} while (0) - -#define vis_membar_storestore() \ - __asm__ volatile(".word 0x8143e008" : : : "memory") - -#define vis_membar_sync() \ - __asm__ volatile(".word 0x8143e040" : : : "memory") - /* 16 and 32 bit partitioned addition and subtraction. The normal * versions perform 4 16-bit or 2 32-bit additions or subtractions. * The 's' versions perform 2 16-bit or 1 32-bit additions or @@ -266,38 +240,6 @@ static inline void vis_alignaddr_g0(void *_ptr) vis_rd_s(0))); } -static inline void *vis_alignaddrl(void *_ptr) -{ - register void *ptr __asm__("g1"); - - ptr = _ptr; - - __asm__ volatile(".word %2" - : "=&r" (ptr) - : "0" (ptr), - "i" (vis_opc_base | vis_opf(0x19) | - vis_rs1_s(1) | - vis_rs2_s(0) | - vis_rd_s(1))); - - return ptr; -} - -static inline void vis_alignaddrl_g0(void *_ptr) -{ - register void *ptr __asm__("g1"); - - ptr = _ptr; - - __asm__ volatile(".word %2" - : "=&r" (ptr) - : "0" (ptr), - "i" (vis_opc_base | vis_opf(0x19) | - vis_rs1_s(1) | - vis_rs2_s(0) | - vis_rd_s(0))); -} - #define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd) /* Logical operate instructions. */ -- cgit v1.2.3