diff options
author | ramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-29 23:02:01 +0000 |
---|---|---|
committer | ramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-29 23:02:01 +0000 |
commit | 7f0e696575c6b33b267ebc540d63e9033246e445 (patch) | |
tree | aaef246f20b40328ccdd54ada3e5257e87d2ac97 /libswscale/swscale-example.c | |
parent | 289d5fc85ebd1cff2aabef2585dc27f4d98be213 (diff) |
swscale: Check for return values of malloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29584 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale/swscale-example.c')
-rw-r--r-- | libswscale/swscale-example.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 44aef6a961..1402d44a17 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -183,8 +183,9 @@ end: static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h) { const int flags[] = { SWS_FAST_BILINEAR, - SWS_BILINEAR, SWS_BICUBIC, - SWS_X , SWS_POINT , SWS_AREA, 0 }; +// SWS_BILINEAR, SWS_BICUBIC, +// SWS_X , SWS_POINT , SWS_AREA, 0 }; + 0 }; const int srcW = w; const int srcH = h; const int dstW[] = { srcW - srcW/3, srcW, srcW + srcW/3, 0 }; @@ -225,6 +226,9 @@ int main(int argc, char **argv) struct SwsContext *sws; AVLFG rand; + if (!rgb_data || !data) + return -1; + sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); av_lfg_init(&rand, 1); |