avcodec/snowenc-test: check for av_malloc*() failures

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-13 15:02:36 +01:00
parent c648879827
commit 482761b85a
1 changed files with 5 additions and 0 deletions

View File

@ -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");