[FFmpeg-cvslog] sws: Print an error in case of av_malloc() failure

Michael Niedermayer git at videolan.org
Mon Dec 19 16:38:06 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 19 16:01:37 2011 +0100| [32a92d325893f15c8f3cbe8dfd4bc6075178039b] | committer: Michael Niedermayer

sws: Print an error in case of av_malloc() failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32a92d325893f15c8f3cbe8dfd4bc6075178039b
---

 libswscale/utils.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 294dd1a..3adf03a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -948,7 +948,10 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
 #else
             if (!c->lumMmx2FilterCode || !c->chrMmx2FilterCode)
 #endif
+            {
+                av_log(c, AV_LOG_ERROR, "Failed to allocate MMX2FilterCode\n");
                 return AVERROR(ENOMEM);
+            }
             FF_ALLOCZ_OR_GOTO(c, c->hLumFilter   , (dstW        /8+8)*sizeof(int16_t), fail);
             FF_ALLOCZ_OR_GOTO(c, c->hChrFilter   , (c->chrDstW  /4+8)*sizeof(int16_t), fail);
             FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW      /2/8+8)*sizeof(int32_t), fail);



More information about the ffmpeg-cvslog mailing list