Commit f2579dbb authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 21051af2
...@@ -184,6 +184,8 @@ static int thp_read_packet(AVFormatContext *s, ...@@ -184,6 +184,8 @@ static int thp_read_packet(AVFormatContext *s,
pkt->stream_index = thp->video_stream_index; pkt->stream_index = thp->video_stream_index;
} else { } else {
ret = av_get_packet(pb, pkt, thp->audiosize); ret = av_get_packet(pb, pkt, thp->audiosize);
if (ret < 0)
return ret;
if (ret != thp->audiosize) { if (ret != thp->audiosize) {
av_free_packet(pkt); av_free_packet(pkt);
return AVERROR(EIO); return AVERROR(EIO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment