git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eac31dd
)
mpc7: check for allocation failure
author
Justin Ruggles
<justin.ruggles@gmail.com>
Mon, 30 Jan 2012 19:33:01 +0000
(14:33 -0500)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Tue, 31 Jan 2012 00:11:29 +0000
(19:11 -0500)
libavcodec/mpc7.c
patch
|
blob
|
history
diff --git
a/libavcodec/mpc7.c
b/libavcodec/mpc7.c
index
8bc0853
..
6b6bffe
100644
(file)
--- a/
libavcodec/mpc7.c
+++ b/
libavcodec/mpc7.c
@@
-224,6
+224,8
@@
static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
}
bits = av_malloc(((buf_size - 1) & ~3) + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!bits)
+ return AVERROR(ENOMEM);
c->dsp.bswap_buf((uint32_t*)bits, (const uint32_t*)(buf + 4), (buf_size - 4) >> 2);
init_get_bits(&gb, bits, (buf_size - 4)* 8);
skip_bits_long(&gb, buf[0]);