avcodec/wmalosslessdec: deallocate uninitialized frame on decode_tilehdr() failure
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jan 2014 00:59:20 +0000 (01:59 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 13 Jan 2014 15:10:12 +0000 (16:10 +0100)
Fixes use of uninitialized memory
partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae3856dcaf9c5ef339969c95a72bcaf7c4bba9ec)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wmalosslessdec.c

index 6386930..8487af9 100644 (file)
@@ -1040,6 +1040,7 @@ static int decode_frame(WmallDecodeCtx *s)
     /* decode tile information */
     if ((ret = decode_tilehdr(s))) {
         s->packet_loss = 1;
+        av_frame_unref(s->frame);
         return ret;
     }