mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
Reviewed-by: maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cd9ff4e3a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e112096885
commit
f3da3e2aed
@ -222,9 +222,19 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0];
|
||||
break;
|
||||
}
|
||||
pic->width = w;
|
||||
pic->height = h;
|
||||
pic->format = avctx->pix_fmt;
|
||||
|
||||
if (avctx->refcounted_frames) {
|
||||
int ret = av_frame_ref((AVFrame*)data, pic);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
av_frame_move_ref((AVFrame*)data, pic);
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
av_frame_move_ref((AVFrame*)data, pic);
|
||||
|
||||
return avpkt->size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user