From: Patrice Clement <[email protected]>

---
 libavcodec/mpeg12dec.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index b66bdc1..82aff4b 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2631,10 +2631,13 @@ static int mpeg_decode_frame(AVCodecContext *avctx, 
void *data,
     if (s2->flags & CODEC_FLAG_TRUNCATED) {
         int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
                                            buf_size, NULL);
-
-        if (ff_combine_frame(&s2->parse_context, next,
-                             (const uint8_t **) &buf, &buf_size) < 0)
+        int ret  = ff_combine_frame(&s2->parse_context, next,
+                                    (const uint8_t **)&buf, &buf_size);
+        if (ret == AVERROR(EAGAIN))
             return buf_size;
+
+        if (ret == AVERROR(ENOMEM))
+            return ret;
     }
 
     if (s->mpeg_enc_ctx_allocated == 0 && avctx->codec_tag == AV_RL32("VCR2"))
-- 
1.9.3 (Apple Git-50)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to