[FFmpeg-cvslog] lavc/libschroedinger: add missing failure checks in ff_create_schro_frame()

Stefano Sabatini git at videolan.org
Tue Jun 19 17:00:56 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Jun 19 13:01:07 2012 +0200| [5793a6d9f9b35723f4aaeba68630f63b45d915f8] | committer: Stefano Sabatini

lavc/libschroedinger: add missing failure checks in ff_create_schro_frame()

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

 libavcodec/libschroedinger.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c
index 631035e..23bcf2d 100644
--- a/libavcodec/libschroedinger.c
+++ b/libavcodec/libschroedinger.c
@@ -189,7 +189,10 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avccontext,
     uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
 
     p_pic = av_mallocz(sizeof(AVPicture));
-    avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height);
+    if (!p_pic || avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height) < 0) {
+        av_free(p_pic);
+        return NULL;
+    }
 
     p_frame         = schro_frame_new();
     p_frame->format = schro_frame_fmt;



More information about the ffmpeg-cvslog mailing list