summaryrefslogtreecommitdiff
path: root/libavcodec/ljpegenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/ljpegenc.c')
-rw-r--r--libavcodec/ljpegenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index 555bffa4ee..c7291ada67 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -63,7 +63,10 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits(&s->pb, pkt->data, pkt->size);
- *p = *pict;
+ av_frame_unref(p);
+ ret = av_frame_ref(p, pict);
+ if (ret < 0)
+ return ret;
p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1;