[FFmpeg-cvslog] avformat/thp: Check av_get_packet() for failure not only for partial output

Michael Niedermayer git at videolan.org
Thu Feb 5 05:23:26 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Feb  5 03:45:21 2015 +0100| [f2579dbb4b31e6ae731e7f5555680528ef3020ab] | committer: Michael Niedermayer

avformat/thp: Check av_get_packet() for failure not only for partial output

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 at gmx.at>

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

 libavformat/thp.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 714cec6..91fa90f 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -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);



More information about the ffmpeg-cvslog mailing list