changeset 9370:25fa07ef8e2b libavcodec

Make sure the block array is of the correct size. This might have been exploitable.
author michael
date Thu, 09 Apr 2009 18:47:50 +0000
parents 539e18dfc86a
children 6de6fb68621c
files snow.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/snow.c	Thu Apr 09 18:37:26 2009 +0000
+++ b/snow.c	Thu Apr 09 18:47:50 2009 +0000
@@ -1626,6 +1626,7 @@
     s->b_width = w;
     s->b_height= h;
 
+    av_free(s->block);
     s->block= av_mallocz(w * h * sizeof(BlockNode) << (s->block_max_depth*2));
     return 0;
 }
@@ -4517,7 +4518,7 @@
                                               && p->hcoeff[2]==2;
     }
 
-    if(!s->block) alloc_blocks(s);
+    alloc_blocks(s);
 
     frame_start(s);
     //keyframe flag duplication mess FIXME