diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-06-19 13:01:07 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-06-19 16:44:34 +0200 |
commit | 5793a6d9f9b35723f4aaeba68630f63b45d915f8 (patch) | |
tree | 4618398e6f221fecfe7030051e56ea6dc4b2dfac /libavcodec/libschroedinger.c | |
parent | 97726e86be8973ac72cbbd7fc723bad929572074 (diff) | |
download | ffmpeg-5793a6d9f9b35723f4aaeba68630f63b45d915f8.tar.gz |
lavc/libschroedinger: add missing failure checks in ff_create_schro_frame()
Diffstat (limited to 'libavcodec/libschroedinger.c')
-rw-r--r-- | libavcodec/libschroedinger.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c index 631035e240..23bcf2d136 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; |