diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-29 15:11:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-29 15:11:34 +0200 |
commit | b96dc093eaf3adaf5df80559cbbaba00d1708adf (patch) | |
tree | 81ed0d099ff08881dde2451de4f5a7b119d272fd | |
parent | 8672fc7b0453098d862bb1c0caafab4823ee0b4e (diff) | |
parent | 065b3a1cfa3f23aedf76244b3f3883ba913173ff (diff) | |
download | ffmpeg-b96dc093eaf3adaf5df80559cbbaba00d1708adf.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
wmalosslessdec: increase channel_coeffs/residues size
wmalosslessdec: increase WMALL_BLOCK_MAX_BITS to 14.
lagarith: check count before writing zeros.
wmaprodec: check num_vec_coeffs for validity
avidec: use actually read size instead of requested size
avidec: return 0, not packet size from read_packet().
Conflicts:
libavcodec/lagarith.c
libavcodec/wmalosslessdec.c
libavcodec/wmaprodec.c
libavformat/avidec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/lagarith.c | 5 | ||||
-rw-r--r-- | libavcodec/wmalosslessdec.c | 13 | ||||
-rw-r--r-- | libavformat/avidec.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 09ae402e5c..261e39c21f 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -365,10 +365,11 @@ static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst, output_zeros: if (l->zeros_rem) { count = FFMIN(l->zeros_rem, width - i); - if(end - dst < count) { - av_log(l->avctx, AV_LOG_ERROR, "too many zeros remaining\n"); + if (end - dst < count) { + av_log(l->avctx, AV_LOG_ERROR, "Too many zeros remaining.\n"); return AVERROR_INVALIDDATA; } + memset(dst, 0, count); l->zeros_rem -= count; dst += count; diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 485cab206c..cdd4eb851b 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -23,6 +23,8 @@ */ #include "libavutil/attributes.h" +#include "libavutil/avassert.h" + #include "avcodec.h" #include "internal.h" #include "get_bits.h" @@ -38,7 +40,7 @@ #define MAX_ORDER 256 #define WMALL_BLOCK_MIN_BITS 6 ///< log2 of min block size -#define WMALL_BLOCK_MAX_BITS 12 ///< log2 of max block size +#define WMALL_BLOCK_MAX_BITS 14 ///< log2 of max block size #define WMALL_BLOCK_MAX_SIZE (1 << WMALL_BLOCK_MAX_BITS) ///< maximum block size #define WMALL_BLOCK_SIZES (WMALL_BLOCK_MAX_BITS - WMALL_BLOCK_MIN_BITS + 1) ///< possible block sizes @@ -213,12 +215,9 @@ static av_cold int decode_init(AVCodecContext *avctx) s->len_prefix = s->decode_flags & 0x40; /* get frame len */ - bits = ff_wma_get_frame_len_bits(avctx->sample_rate, 3, s->decode_flags); - if (bits > WMALL_BLOCK_MAX_BITS) { - av_log_missing_feature(avctx, "big-bits block sizes", 1); - return AVERROR_INVALIDDATA; - } - s->samples_per_frame = 1 << bits; + s->samples_per_frame = 1 << ff_wma_get_frame_len_bits(avctx->sample_rate, + 3, s->decode_flags); + av_assert0(s->samples_per_frame <= WMALL_BLOCK_MAX_SIZE); /* init previous block len */ for (i = 0; i < avctx->channels; i++) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index c4d41e5449..de945829f4 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1205,7 +1205,7 @@ resync: } ast->frame_offset += get_duration(ast, pkt->size); } - ast->remaining -= size; + ast->remaining -= err; if(!ast->remaining){ avi->stream_index= -1; ast->packet_size= 0; @@ -1227,7 +1227,7 @@ resync: avi->dts_max = dts; } - return size; + return 0; } if ((err = avi_sync(s, 0)) < 0) |