mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
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>
This commit is contained in:
parent
52d2bcc786
commit
a26e9c1040
@ -539,10 +539,9 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
|
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
pic = av_frame_alloc();
|
pic = av_frame_clone(pic_arg);
|
||||||
if (!pic)
|
if (!pic)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
av_frame_ref(pic, pic_arg);
|
|
||||||
//picture should be flipped upside-down
|
//picture should be flipped upside-down
|
||||||
for(i=0; i < 3; i++) {
|
for(i=0; i < 3; i++) {
|
||||||
int vsample = i ? 2 >> chroma_v_shift : 2;
|
int vsample = i ? 2 >> chroma_v_shift : 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user