summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-04 01:08:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-04 01:08:57 +0200
commitcf8c44fc47330833fadc505dfef2c2c1ae03a561 (patch)
treea0bdeb3e3eaafae22424ac538437cf801a39e562
parentb28fcbba0c278f9db5d29c9629aa3f70a4b48cd7 (diff)
parentc6698dfe7cdbc7634f33245875488ed3fa4a8ced (diff)
Merge commit 'c6698dfe7cdbc7634f33245875488ed3fa4a8ced'
* commit 'c6698dfe7cdbc7634f33245875488ed3fa4a8ced': webpdec: Fix decoding of the huffman group indices. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/webp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 19cb1fc223..c737f5492d 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -482,7 +482,9 @@ static int decode_entropy_image(WebPContext *s)
max = 0;
for (y = 0; y < img->frame->height; y++) {
for (x = 0; x < img->frame->width; x++) {
- int p = GET_PIXEL_COMP(img->frame, x, y, 2);
+ int p0 = GET_PIXEL_COMP(img->frame, x, y, 1);
+ int p1 = GET_PIXEL_COMP(img->frame, x, y, 2);
+ int p = p0 << 8 | p1;
max = FFMAX(max, p);
}
}
@@ -567,7 +569,9 @@ static HuffReader *get_huffman_group(WebPContext *s, ImageContext *img,
if (gimg->size_reduction > 0) {
int group_x = x >> gimg->size_reduction;
int group_y = y >> gimg->size_reduction;
- group = GET_PIXEL_COMP(gimg->frame, group_x, group_y, 2);
+ int g0 = GET_PIXEL_COMP(gimg->frame, group_x, group_y, 1);
+ int g1 = GET_PIXEL_COMP(gimg->frame, group_x, group_y, 2);
+ group = g0 << 8 | g1;
}
return &img->huffman_groups[group * HUFFMAN_CODES_PER_META_CODE];