From: Patrice Clement <[email protected]>
---
libavcodec/pnm_parser.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c
index 2e00c0a..16fac99 100644
--- a/libavcodec/pnm_parser.c
+++ b/libavcodec/pnm_parser.c
@@ -29,7 +29,7 @@ static int pnm_parse(AVCodecParserContext *s, AVCodecContext
*avctx,
{
ParseContext *pc = s->priv_data;
PNMContext pnmctx;
- int next;
+ int next, ret;
for (; pc->overread > 0; pc->overread--) {
pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
@@ -73,11 +73,14 @@ retry:
next = END_NOT_FOUND;
}
- 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;
return next;
--
1.9.3 (Apple Git-50)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel