aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-05 03:45:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-05 04:30:41 +0100
commit3508aa142766288c87c471af4de34c204089a800 (patch)
treef20ea5a03bc46136c6a58bf485c32b0628eb03bb
parent42d9a7010f2d24e93c12c001430186d544eea591 (diff)
downloadffmpeg-3508aa142766288c87c471af4de34c204089a800.tar.gz
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@gmx.at> (cherry picked from commit f2579dbb4b31e6ae731e7f5555680528ef3020ab) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/thp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/thp.c b/libavformat/thp.c
index 568807d6f7..3ef9497b42 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -180,6 +180,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);