aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-04 19:00:17 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-27 00:46:33 +0100
commit0e8c44076d313c2addc26c2e03c9e6430fa8cecf (patch)
treef2374a0d99243390ef0113499d97425eea142aa0
parenta94f846e2dbac02191551fc0198282ac57a8ffe5 (diff)
downloadffmpeg-0e8c44076d313c2addc26c2e03c9e6430fa8cecf.tar.gz
diracdec: check return code of get_buffer_with_edge
If it fails, buffers aren't allocated, causing NULL pointer dereferencing. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit db79dedb1ae5dd38432eee3f09155e26f3f2d95a) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index dc56356cff..670cc49c33 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1767,7 +1767,9 @@ static int dirac_decode_picture_header(DiracContext *s)
for (j = 0; j < MAX_FRAMES; j++)
if (!s->all_frames[j].avframe->data[0]) {
s->ref_pics[i] = &s->all_frames[j];
- get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
+ ret = get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
+ if (ret < 0)
+ return ret;
break;
}