From: Luca Barbato <[email protected]>

And check for ENOMEM.
---
 libavcodec/h263_parser.c | 12 ++++++------
 libavcodec/h263dec.c     |  7 +++++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavcodec/h263_parser.c b/libavcodec/h263_parser.c
index 8c7eee3..733984d 100644
--- a/libavcodec/h263_parser.c
+++ b/libavcodec/h263_parser.c
@@ -69,15 +69,15 @@ static int h263_parse(AVCodecParserContext *s,
                       const uint8_t *buf, int buf_size)
 {
     ParseContext *pc = s->priv_data;
-    int next;
+    int next, ret;
 
     next = ff_h263_find_frame_end(pc, buf, buf_size);
-
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
+    ret  = ff_parser_combine_data(pc, next, &buf, &buf_size,
+                                  poutbuf, poutbuf_size);
+    if (ret == AVERROR(EAGAIN))
         return buf_size;
-    }
+    if (ret == AVERROR(ENOMEM))
+        return ret;
 
     *poutbuf      = buf;
     *poutbuf_size = buf_size;
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 31e014a..bef6bf4 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -407,9 +407,12 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
             return AVERROR(ENOSYS);
         }
 
-        if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
-                             &buf_size) < 0)
+        ret = ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
+                               &buf_size);
+        if (ret == AVERROR(EAGAIN))
             return buf_size;
+        if (ret == AVERROR(EAGAIN));
+            return ret;
     }
 
     if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 
5.01+/xvid frame reorder
-- 
1.9.3 (Apple Git-50)

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

Reply via email to