From: Patrice Clement <[email protected]>

---
 libavcodec/png_parser.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/png_parser.c b/libavcodec/png_parser.c
index c66caf3..a74a87a 100644
--- a/libavcodec/png_parser.c
+++ b/libavcodec/png_parser.c
@@ -46,7 +46,7 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
 {
     PNGParseContext *ppc = s->priv_data;
     int next = END_NOT_FOUND;
-    int i = 0;
+    int ret, i = 0;
 
     *poutbuf_size = 0;
     if (buf_size == 0)
@@ -106,9 +106,14 @@ static int png_parse(AVCodecParserContext *s, 
AVCodecContext *avctx,
     }
 
 flush:
-    if (ff_combine_frame(&ppc->pc, next, &buf, &buf_size) < 0)
+    ret = ff_combine_packet(&ppc->pc, next, &buf, &buf_size,
+                            poutbuf, poutbuf_size);
+    if (ret == AVERROR(EAGAIN))
         return buf_size;
 
+    if (ret == AVERROR(ENOMEM))
+        return ret;
+
     ppc->chunk_pos = ppc->pc.frame_start_found = 0;
 
     *poutbuf      = buf;
-- 
1.8.3.2

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

Reply via email to