Browse Source

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>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
f2579dbb4b
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/thp.c

+ 2
- 0
libavformat/thp.c View File

@@ -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);


Loading…
Cancel
Save