1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/m[jx]pegdec: Simplify freeing frame

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-04-02 18:32:10 +02:00
parent 7ddcd55d51
commit 1267273663
2 changed files with 2 additions and 7 deletions

View File

@ -2954,11 +2954,8 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
av_log(avctx, AV_LOG_INFO, "Single field\n");
}
if (s->picture) {
av_frame_free(&s->picture);
s->picture_ptr = NULL;
} else if (s->picture_ptr)
av_frame_unref(s->picture_ptr);
av_frame_free(&s->picture);
s->picture_ptr = NULL;
av_frame_free(&s->smv_frame);

View File

@ -47,10 +47,8 @@ typedef struct MXpegDecodeContext {
static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
{
MXpegDecodeContext *s = avctx->priv_data;
MJpegDecodeContext *jpg = &s->jpg;
int i;
jpg->picture_ptr = NULL;
ff_mjpeg_decode_end(avctx);
for (i = 0; i < 2; ++i)