mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
vp56: Ignore reconfiguration from the alpha plane.
Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ec79b1fc88
commit
9c208b404c
@ -547,6 +547,10 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s->has_alpha) {
|
if (s->has_alpha) {
|
||||||
|
int bak_w = avctx->width;
|
||||||
|
int bak_h = avctx->height;
|
||||||
|
int bak_cw = avctx->coded_width;
|
||||||
|
int bak_ch = avctx->coded_height;
|
||||||
buf += alpha_offset;
|
buf += alpha_offset;
|
||||||
remaining_buf_size -= alpha_offset;
|
remaining_buf_size -= alpha_offset;
|
||||||
|
|
||||||
@ -554,14 +558,12 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
if (res != 1) {
|
if (res != 1) {
|
||||||
if(res==2) {
|
if(res==2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Alpha reconfiguration\n");
|
av_log(avctx, AV_LOG_ERROR, "Alpha reconfiguration\n");
|
||||||
for (i = 0; i < 4; i++) {
|
avctx->width = bak_w;
|
||||||
if (s->frames[i].data[0])
|
avctx->height = bak_h;
|
||||||
avctx->release_buffer(avctx, &s->frames[i]);
|
avctx->coded_width = bak_cw;
|
||||||
av_assert0(!s->alpha_context->frames[i].data[0]);
|
avctx->coded_height = bak_ch;
|
||||||
}
|
}
|
||||||
vp56_size_changed(s);
|
avctx->release_buffer(avctx, p);
|
||||||
}else
|
|
||||||
avctx->release_buffer(avctx, p);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user