diff options
author | Andrey Utkin <andrey.krieger.utkin@gmail.com> | 2011-12-08 15:56:29 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-12-14 21:17:21 +0400 |
commit | 4f820131fa9fbb0a64d7cc469fa471905fc91944 (patch) | |
tree | 7c291b220f142617c22de3c4d89c8c2fd4b4bc06 /libavcodec/mpegvideo_enc.c | |
parent | 71ce76027d9df47f4ac80c2c114b47d51243ed8e (diff) |
mpegvideo: remove abort() in ff_find_unused_picture()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index ce428661ee..14f5447d07 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -858,6 +858,8 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){ if(direct){ i= ff_find_unused_picture(s, 1); + if (i < 0) + return i; pic= (AVFrame*)&s->picture[i]; pic->reference= 3; @@ -871,6 +873,8 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){ } }else{ i= ff_find_unused_picture(s, 0); + if (i < 0) + return i; pic= (AVFrame*)&s->picture[i]; pic->reference= 3; @@ -1200,6 +1204,8 @@ no_output_pic: // input is a shared pix, so we can't modifiy it -> alloc a new one & ensure that the shared one is reuseable int i= ff_find_unused_picture(s, 0); + if (i < 0) + return i; Picture *pic= &s->picture[i]; pic->f.reference = s->reordered_input_picture[0]->f.reference; |