Fixes CID1026740
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -1016,7 +1016,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
1016 | 1016 |
ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8); |
1017 | 1017 |
|
1018 | 1018 |
av_frame_unref(p); |
1019 |
- av_frame_ref(p, pict); |
|
1019 |
+ if ((ret = av_frame_ref(p, pict)) < 0) |
|
1020 |
+ return ret; |
|
1020 | 1021 |
p->pict_type = AV_PICTURE_TYPE_I; |
1021 | 1022 |
|
1022 | 1023 |
if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) { |