diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-06 01:45:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-06 01:45:29 +0200 |
commit | 6552b0558a15b05c49976b393f2d3123c317df3a (patch) | |
tree | 5dbe992dcaafa11dda211b8b3a3db41e13fc389d /libavutil/pixelutils.c | |
parent | 84ac2f93ca112769f6f0892e5deaed5a48706dcc (diff) | |
download | ffmpeg-6552b0558a15b05c49976b393f2d3123c317df3a.tar.gz |
avutil/pixelutils: check for malloc failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/pixelutils.c')
-rw-r--r-- | libavutil/pixelutils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/pixelutils.c b/libavutil/pixelutils.c index ca424d89e4..10ff7e801a 100644 --- a/libavutil/pixelutils.c +++ b/libavutil/pixelutils.c @@ -128,6 +128,12 @@ int main(void) uint8_t *buf2 = av_malloc(W2*H2); uint32_t state = 0; + if (!buf1 || !buf2) { + fprintf(stderr, "malloc failure\n"); + ret = 1; + goto end; + } + for (i = 0; i < W1*H1; i++) { state = state * 1664525 + 1013904223; buf1[i] = state>>24; |