[FFmpeg-cvslog] avcodec/snow: fix null pointer dereference in cleanup after allocation failure

Michael Niedermayer git at videolan.org
Mon Aug 11 19:12:39 CEST 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Mon Aug 11 15:36:22 2014 +0200| [bb7f236c7fefa3a8918f1578bc4c82f38395ef94] | committer: Michael Niedermayer

avcodec/snow: fix null pointer dereference in cleanup after allocation failure

Fixes: snowf.avi
Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 9a162146ca6cc12ef7ad4a15164349482885962c)

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

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

 libavcodec/snow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c645b12..5184acd 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -689,7 +689,7 @@ av_cold void ff_snow_common_end(SnowContext *s)
     for(i=0; i<MAX_REF_FRAMES; i++){
         av_freep(&s->ref_mvs[i]);
         av_freep(&s->ref_scores[i]);
-        if(s->last_picture[i]->data[0]) {
+        if(s->last_picture[i] && s->last_picture[i]->data[0]) {
             av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]);
         }
         av_frame_free(&s->last_picture[i]);



More information about the ffmpeg-cvslog mailing list