diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-05 03:45:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-12 18:03:50 +0100 |
commit | 3b90117a1f9a29dfe9588ad5de8c3f4b9640cc38 (patch) | |
tree | 8e6ad5c8dc55250c37b869c1bb07cbdbca9db501 | |
parent | a16669f1e226e15c5e970e2ab48b2c54ed7ee77a (diff) | |
download | ffmpeg-3b90117a1f9a29dfe9588ad5de8c3f4b9640cc38.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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/thp.c b/libavformat/thp.c index 75f7941ff8..bed3f599c2 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -179,6 +179,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); |