mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 11:39:47 +00:00
avcodec/a64multienc: use av_frame_ref instead of copying the frame
This fixes freeing the frame buffer twice on cleanup leading to a crash. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
fab8b88a5e
commit
39e4ed7c1d
@ -317,7 +317,9 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
} else {
|
} else {
|
||||||
/* fill up mc_meta_charset with data until lifetime exceeds */
|
/* fill up mc_meta_charset with data until lifetime exceeds */
|
||||||
if (c->mc_frame_counter < c->mc_lifetime) {
|
if (c->mc_frame_counter < c->mc_lifetime) {
|
||||||
*p = *pict;
|
ret = av_frame_ref(p, pict);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
p->pict_type = AV_PICTURE_TYPE_I;
|
p->pict_type = AV_PICTURE_TYPE_I;
|
||||||
p->key_frame = 1;
|
p->key_frame = 1;
|
||||||
to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
|
to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
|
||||||
|
Loading…
Reference in New Issue
Block a user