diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-13 15:02:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-13 15:02:36 +0100 |
commit | 482761b85a686c24dda18780a1c7e1e82c45e43c (patch) | |
tree | 828c6ac33aa8f32e4e7f36d9a4d1c0d7b5590510 /libavcodec/snowenc.c | |
parent | c648879827d3d8a4d4431fa3ef49d5b5c43c3843 (diff) |
avcodec/snowenc-test: check for av_malloc*() failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r-- | libavcodec/snowenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index cbc89c985b..73b544a734 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1922,6 +1922,11 @@ int main(void){ s.temp_dwt_buffer = av_mallocz(width * sizeof(DWTELEM)); s.temp_idwt_buffer = av_mallocz(width * sizeof(IDWTELEM)); + if (!s.temp_dwt_buffer || !s.temp_idwt_buffer) { + fprintf(stderr, "Failed to allocate memory\n"); + return 1; + } + av_lfg_init(&prng, 1); printf("testing 5/3 DWT\n"); |