avutil/pixelutils: check for malloc failure
Found-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
84ac2f93ca
commit
6552b0558a
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue