diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-13 04:03:54 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-13 04:22:43 +0400 |
commit | 7b41cbac7fc03cfc4714049fbe849cb3f96ffaa5 (patch) | |
tree | 0c778ad61ce4809b1a404374a96440604a6bc8fd /libavcodec/huffyuvenc.c | |
parent | af68bd1c06ff9ea7379a95d39d5fde5fa1938cd3 (diff) |
avcodec/huffman: extend ff_huff_gen_len_table() to allow >8bit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/huffyuvenc.c')
-rw-r--r-- | libavcodec/huffyuvenc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 36dfecd5fb..0ab61b26c0 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -144,7 +144,7 @@ static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf) static int store_huffman_tables(HYuvContext *s, uint8_t *buf) { - int i; + int i, ret; int size = 0; int count = 3; @@ -152,7 +152,8 @@ static int store_huffman_tables(HYuvContext *s, uint8_t *buf) 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 ((ret = ff_huff_gen_len_table(s->len[i], s->stats[i], 256)) < 0) + return ret; if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0) { return -1; |