ivi_common: dont dereference null pointers.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Nov 2012 13:17:17 +0000 (14:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Nov 2012 13:17:42 +0000 (14:17 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ivi_common.c

index fb553fd..32c0b0f 100644 (file)
@@ -239,6 +239,7 @@ av_cold void ff_ivi_free_buffers(IVIPlaneDesc *planes)
     int p, b, t;
 
     for (p = 0; p < 3; p++) {
+        if (planes[p].bands)
         for (b = 0; b < planes[p].num_bands; b++) {
             av_freep(&planes[p].bands[b].bufs[0]);
             av_freep(&planes[p].bands[b].bufs[1]);