aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-08 12:38:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-08 12:39:31 +0100
commit5d4541007f1dad20866458176ac7f63d9eb21d94 (patch)
tree3ecd71dea02edac07a3bffa898a6f176b04aed39
parent2358458a7587715e78e38b32fcef98dc3f5fd728 (diff)
downloadffmpeg-5d4541007f1dad20866458176ac7f63d9eb21d94.tar.gz
avcodec/huffyuvenc: fix -context 1 encoding
Fixes Ticket3281 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/huffyuvenc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index f825fe3f2c..dc9d770b46 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -554,7 +554,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return ret;
if (s->context) {
- for (i = 0; i < 4; i++) {
+ int count = 3;
+
+ if (s->version > 2)
+ count = 1 + s->alpha + 2*s->chroma;
+
+ for (i = 0; i < count; i++) {
ff_huff_gen_len_table(s->len[i], s->stats[i]);
if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0)
return -1;