]> git.sesse.net Git - ffmpeg/commitdiff
avformat/thp: Check av_get_packet() for failure not only for partial output
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Feb 2015 02:45:21 +0000 (03:45 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Feb 2015 03:14:42 +0000 (04:14 +0100)
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/thp.c

index 714cec6cd32485ab26070307b5084eb56d8c5c7f..91fa90f94215a81537de699c704ccc5c9ce9f113 100644 (file)
@@ -184,6 +184,8 @@ static int thp_read_packet(AVFormatContext *s,
         pkt->stream_index = thp->video_stream_index;
     } else {
         ret = av_get_packet(pb, pkt, thp->audiosize);
+        if (ret < 0)
+            return ret;
         if (ret != thp->audiosize) {
             av_free_packet(pkt);
             return AVERROR(EIO);