avcodec/vp56: Roll back dimensions when resizing fails

The VP5/VP6 headers install new dimensions before vp56_size_changed() allocates the arrays for them.  If resizing fails, leave the dimensions cleared so following frames cannot use the missing arrays, and preserve the allocation error for the caller.

Fixes: 24187

Assisted-by: Fairy
This commit is contained in:
Michael Niedermayer authored and Peter Ross committed 2026-10-27 05:04:53 +00:00
1 parent a497ab4d07
commit 192118f179
1 file changed
+4 -2
+4 -2
View File
@@ -654,9 +654,11 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
}
if (res == VP56_SIZE_CHANGE) {
if (vp56_size_changed(s)) {
ret = vp56_size_changed(s);
if (ret < 0) {
av_frame_unref(p);
return AVERROR_INVALIDDATA;
ff_set_dimensions(avctx, 0, 0);
return ret;
}
}