summaryrefslogtreecommitdiff
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-29 01:41:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-29 04:11:10 +0200
commitd40ff29cacf9b8ffa1061392a0e9b3056c4882ea (patch)
tree3b59f4b9a74e209220f0b0dcb90c466e3e4a9b3d /libavcodec/cook.c
parent99bb88c588ea9a46a06b966b9014394385ebe1c3 (diff)
parent44257ef4267f01dd698c8ab8abf50fd77136a8ce (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: asf: only set index_read if the index contained entries. cabac: add overread protection to BRANCHLESS_GET_CABAC(). cabac: increment jump locations by one in callers of BRANCHLESS_GET_CABAC(). cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE(). cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC(). h264: add overread protection to get_cabac_bypass_sign_x86(). h264: reindent get_cabac_bypass_sign_x86(). h264: use struct offsets in get_cabac_bypass_sign_x86(). h264: fix overreads in cabac reader. wmall: fix seeking. lagarith: fix buffer overreads. dvdec: drop unnecessary dv_tablegen.h #include build: fix doc generation errors in parallel builds Replace memset(0) by zero initializations. faandct: Remove FAAN_POSTSCALE define and related code. dvenc: print allowed profiles if the video doesn't conform to any of them. avcodec_encode_{audio,video}: only reallocate output packet when it has non-zero size. FATE: add a test for vp8 with changing frame size. fate: add kgv1 fate test. oggdec: calculate correct timestamps in Ogg/FLAC Conflicts: libavcodec/4xm.c libavcodec/cook.c libavcodec/dvdata.c libavcodec/dvdsubdec.c libavcodec/lagarith.c libavcodec/lagarithrac.c libavcodec/utils.c tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 31b0f1f8b0..cde2752ea7 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -411,10 +411,10 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
int *category, int *category_index)
{
int exp_idx, bias, tmpbias1, tmpbias2, bits_left, num_bits, index, v, i, j;
- int exp_index2[102];
- int exp_index1[102];
+ int exp_index2[102] = { 0 };
+ int exp_index1[102] = { 0 };
- int tmp_categorize_array[128 * 2];
+ int tmp_categorize_array[128 * 2] = { 0 };
int tmp_categorize_array1_idx = p->numvector_size;
int tmp_categorize_array2_idx = p->numvector_size;
@@ -426,10 +426,6 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
//av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
}
- memset(&exp_index1, 0, sizeof(exp_index1));
- memset(&exp_index2, 0, sizeof(exp_index2));
- memset(&tmp_categorize_array, 0, sizeof(tmp_categorize_array));
-
bias = -32;
/* Estimate bias. */
@@ -649,14 +645,11 @@ static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category,
*/
static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer)
{
- int category_index[128];
+ int category_index[128] = { 0 };
+ int category[128] = { 0 };
int quant_index_table[102];
- int category[128];
int res, i;
- memset(&category, 0, sizeof(category));
- memset(&category_index, 0, sizeof(category_index));
-
if ((res = decode_envelope(q, p, quant_index_table)) < 0)
return res;
q->num_vectors = get_bits(&q->gb, p->log2_numvector_size);
@@ -829,13 +822,12 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
float *mlt_buffer2)
{
int i, j, res;
- int decouple_tab[SUBBAND_SIZE];
+ int decouple_tab[SUBBAND_SIZE] = { 0 };
float *decode_buffer = q->decode_buffer_0;
int idx, cpl_tmp;
float f1, f2;
const float *cplscale;
- memset(decouple_tab, 0, sizeof(decouple_tab));
memset(decode_buffer, 0, sizeof(q->decode_buffer_0));
/* Make sure the buffers are zeroed out. */