You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/ffv1dec: Fix >8bps error concealment
Fixes: 03_cave_girls_h264_slc24_slicecrc1_fuzzed.avi Found-by: Dinah Handel <dinahrhandel@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -979,16 +979,18 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
|||||||
FFV1Context *fs = f->slice_context[i];
|
FFV1Context *fs = f->slice_context[i];
|
||||||
int j;
|
int j;
|
||||||
if (fs->slice_damaged && f->last_picture.f->data[0]) {
|
if (fs->slice_damaged && f->last_picture.f->data[0]) {
|
||||||
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||||
const uint8_t *src[4];
|
const uint8_t *src[4];
|
||||||
uint8_t *dst[4];
|
uint8_t *dst[4];
|
||||||
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < 4; j++) {
|
||||||
|
int pixshift = desc->comp[j].depth > 8;
|
||||||
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
||||||
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
||||||
dst[j] = p->data[j] + p->linesize[j] *
|
dst[j] = p->data[j] + p->linesize[j] *
|
||||||
(fs->slice_y >> sv) + (fs->slice_x >> sh);
|
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||||
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
||||||
(fs->slice_y >> sv) + (fs->slice_x >> sh);
|
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||||
}
|
}
|
||||||
av_image_copy(dst, p->linesize, src,
|
av_image_copy(dst, p->linesize, src,
|
||||||
f->last_picture.f->linesize,
|
f->last_picture.f->linesize,
|
||||||
|
Reference in New Issue
Block a user