From 36c196bca4be68f8ebf04bf2ac9b972d4f084b9f Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 11 Aug 2011 08:57:58 -0400 Subject: [PATCH] h264: notice memory allocation failure Signed-off-by: Ronald S. Bultje (cherry picked from commit bac3ab13ea6a9dd8853e79ef3eacf51d234c8774) Signed-off-by: Anton Khirnov (cherry picked from commit 59a22afa0b50b9037133a7bc26bdc5023e7e1df9) Conflicts: libavcodec/h264.c Signed-off-by: Reinhard Tartler --- libavcodec/h264.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index e4654f0435..1f045a8be7 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1840,7 +1840,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ h->prev_interlaced_frame = 1; init_scan_tables(h); - ff_h264_alloc_tables(h); + if (ff_h264_alloc_tables(h) < 0) { + av_log(h->s.avctx, AV_LOG_ERROR, "Could not allocate memory for h264\n"); + return AVERROR(ENOMEM); + } for(i = 1; i < s->avctx->thread_count; i++) { H264Context *c;