mirror of https://git.ffmpeg.org/ffmpeg.git
webp: do not call av_frame_free() on the user-provided frame
Fixes double-free on error.
This commit is contained in:
parent
b73a8922d8
commit
f51e3a1971
|
@ -1129,10 +1129,8 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||||
if (is_alpha_chunk)
|
if (is_alpha_chunk)
|
||||||
s->image[IMAGE_ROLE_ARGB].is_alpha_primary = 1;
|
s->image[IMAGE_ROLE_ARGB].is_alpha_primary = 1;
|
||||||
ret = decode_entropy_coded_image(s, IMAGE_ROLE_ARGB, w, h);
|
ret = decode_entropy_coded_image(s, IMAGE_ROLE_ARGB, w, h);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
av_frame_free(&p);
|
|
||||||
goto free_and_return;
|
goto free_and_return;
|
||||||
}
|
|
||||||
|
|
||||||
/* apply transformations */
|
/* apply transformations */
|
||||||
for (i = s->nb_transforms - 1; i >= 0; i--) {
|
for (i = s->nb_transforms - 1; i >= 0; i--) {
|
||||||
|
@ -1150,10 +1148,8 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||||
ret = apply_color_indexing_transform(s);
|
ret = apply_color_indexing_transform(s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
av_frame_free(&p);
|
|
||||||
goto free_and_return;
|
goto free_and_return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*got_frame = 1;
|
*got_frame = 1;
|
||||||
|
|
Loading…
Reference in New Issue