summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-24 03:24:55 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-24 03:24:55 +0100
commita26e9c1040afeecf9013da742b0dec7009445f2b (patch)
treed03f69ffa3f35836d86b6ac7a766a785d6806863 /libavcodec/mjpegenc.c
parent52d2bcc78632f868cc4045c8f1cd03533418f0b6 (diff)
avcodec/mjpegenc: Use av_frame_clone() instead of av_frame_ref()
This avoids the need for double error checking Fixes CID1163843 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r--libavcodec/mjpegenc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 44e1c3c76d..7487ef8f66 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -539,10 +539,9 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
return AVERROR(EINVAL);
- pic = av_frame_alloc();
+ pic = av_frame_clone(pic_arg);
if (!pic)
return AVERROR(ENOMEM);
- av_frame_ref(pic, pic_arg);
//picture should be flipped upside-down
for(i=0; i < 3; i++) {
int vsample = i ? 2 >> chroma_v_shift : 2;