aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-05 03:45:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 00:47:05 +0100
commitf3a776a9433cfc935d56264f1c52873249477e12 (patch)
treec30d31f5699ccf988709f30bbc2f02bc689d1594
parent75b0cfcf105c8720a47a2ee80a70ba16799d71b7 (diff)
downloadffmpeg-f3a776a9433cfc935d56264f1c52873249477e12.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 2d1f74e38b..ec2bb18076 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -174,6 +174,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);