From: Luca Barbato <[email protected]>

---
 libavcodec/mjpeg_parser.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mjpeg_parser.c b/libavcodec/mjpeg_parser.c
index bbe90a9..fac7aba 100644
--- a/libavcodec/mjpeg_parser.c
+++ b/libavcodec/mjpeg_parser.c
@@ -76,18 +76,17 @@ static int jpeg_parse(AVCodecParserContext *s,
                       const uint8_t *buf, int buf_size)
 {
     ParseContext *pc = s->priv_data;
-    int next;
+    int next, ret;
 
     if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
         next = buf_size;
     } else {
         next = find_frame_end(pc, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf      = NULL;
-            *poutbuf_size = 0;
+        ret = ff_combine_frame(pc, next, &buf, &buf_size);
+        if (ret == AVERROR(EAGAIN))
             return buf_size;
-        }
+        if (ret == AVERROR(ENOMEM))
+            return ret;
     }
 
     *poutbuf      = buf;
-- 
1.9.3 (Apple Git-50)

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

Reply via email to