From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- chromium/third_party/ffmpeg/libavcodec/ffv1dec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'chromium/third_party/ffmpeg/libavcodec/ffv1dec.c') diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c index 6c01ebf15f9..a0a50abed4d 100644 --- a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c +++ b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c @@ -260,7 +260,7 @@ static void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int if (s->slice_coding_mode != 1) { b -= offset; r -= offset; - g -= ((b + r) * s->slice_rct_y_coef) >> 2; + g -= (b * s->slice_rct_by_coef + r * s->slice_rct_ry_coef) >> 2; b += g; r += g; } @@ -334,8 +334,9 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs) fs->slice_reset_contexts = get_rac(c, state); fs->slice_coding_mode = get_symbol(c, state, 0); if (fs->slice_coding_mode != 1) { - fs->slice_rct_y_coef = get_symbol(c, state, 0); - if (fs->slice_rct_y_coef > 2U) { + fs->slice_rct_by_coef = get_symbol(c, state, 0); + fs->slice_rct_ry_coef = get_symbol(c, state, 0); + if ((uint64_t)fs->slice_rct_by_coef + (uint64_t)fs->slice_rct_ry_coef > 4) { av_log(f->avctx, AV_LOG_ERROR, "slice_rct_y_coef out of range\n"); return AVERROR_INVALIDDATA; } @@ -379,16 +380,17 @@ static int decode_slice(AVCodecContext *c, void *arg) pdst->vlc_state = NULL; if (fssrc->ac) { - pdst->state = av_malloc(CONTEXT_SIZE * psrc->context_count); + pdst->state = av_malloc_array(CONTEXT_SIZE, psrc->context_count); memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count); } else { - pdst->vlc_state = av_malloc(sizeof(*pdst->vlc_state) * psrc->context_count); + pdst->vlc_state = av_malloc_array(sizeof(*pdst->vlc_state), psrc->context_count); memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count); } } } - fs->slice_rct_y_coef = 1; + fs->slice_rct_by_coef = 1; + fs->slice_rct_ry_coef = 1; if (f->version > 2) { if (ffv1_init_slice_state(f, fs) < 0) -- cgit v1.2.3