summaryrefslogtreecommitdiff
path: root/libavformat/thp.c
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:14:42 +0100
commitf2579dbb4b31e6ae731e7f5555680528ef3020ab (patch)
treeab9ce3a6bd4040a32759fdb6a7fe7cf0c87107a8 /libavformat/thp.c
parent21051af218d7a6fdfc16036980577cf1765f5cbc (diff)
downloadffmpeg-f2579dbb4b31e6ae731e7f5555680528ef3020ab.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>
Diffstat (limited to 'libavformat/thp.c')
-rw-r--r--libavformat/thp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/thp.c b/libavformat/thp.c
index 714cec6cd3..91fa90f942 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);