Commit 0cd9ff4e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set

Reviewed-by: maintainer
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 54f43984
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment