tak_parser: check ff_combine_frame() return code
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Oct 2012 20:45:51 +0000 (22:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Oct 2012 21:03:07 +0000 (23:03 +0200)
Fixes CID733706
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/tak_parser.c

index dcc37ec..55766a4 100644 (file)
@@ -66,7 +66,8 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx,
             int tmp_buf_size = FFMIN(2 * TAK_MAX_FRAME_HEADER_BYTES, buf_size);
             const uint8_t *tmp_buf = buf;
 
-            ff_combine_frame(pc, END_NOT_FOUND, &tmp_buf, &tmp_buf_size);
+            if (ff_combine_frame(pc, END_NOT_FOUND, &tmp_buf, &tmp_buf_size) != -1)
+                return AVERROR(ENOMEM);
             consumed += tmp_buf_size;
             buf      += tmp_buf_size;
             buf_size -= tmp_buf_size;