From: Patrice Clement <charlier...@free.fr>

---
 libavcodec/tak_parser.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libavcodec/tak_parser.c b/libavcodec/tak_parser.c
index 295df24..b108540 100644
--- a/libavcodec/tak_parser.c
+++ b/libavcodec/tak_parser.c
@@ -49,6 +49,7 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
     GetBitContext gb;
     int consumed = 0;
     int needed   = buf_size ? TAK_MAX_FRAME_HEADER_BYTES : 8;
+    int ret;
 
     if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
         TAKStreamInfo ti;
@@ -67,7 +68,11 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
                                            buf_size);
             const uint8_t *tmp_buf = buf;
 
-            ff_combine_frame(pc, END_NOT_FOUND, &tmp_buf, &tmp_buf_size);
+            ret = ff_combine_packet(pc, END_NOT_FOUND,
+                                    &tmp_buf, &tmp_buf_size);
+            if (ret == AVERROR(ENOMEM))
+                return ret;
+
             consumed += tmp_buf_size;
             buf      += tmp_buf_size;
             buf_size -= tmp_buf_size;
@@ -102,8 +107,11 @@ static int tak_parse(AVCodecParserContext *s, 
AVCodecContext *avctx,
     }
 
 found:
-    if (consumed && !buf_size && next == END_NOT_FOUND ||
-        ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
+    if (consumed && !buf_size && next == END_NOT_FOUND) {
+        ret = ff_combine_frame(pc, next, &buf, &buf_size);
+        if (ret == AVERROR(ENOMEM))
+            return ret;
+
         *poutbuf      = NULL;
         *poutbuf_size = 0;
         return buf_size + consumed;
-- 
1.8.3.2

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to