mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
avformat/mpeg: Check avio_read() return value in get_pts()
Found-by: Thierry Foucu <tfoucu@gmail.com> Fixes: Use-of-uninitialized-value Reviewed-by: Thierry Foucu <tfoucu@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e8a88a16f78e66c8d7645b5f71dc8390b033fa70) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9aad7acc4e
commit
8e729daf08
@ -159,9 +159,12 @@ static int mpegps_read_header(AVFormatContext *s)
|
||||
static int64_t get_pts(AVIOContext *pb, int c)
|
||||
{
|
||||
uint8_t buf[5];
|
||||
int ret;
|
||||
|
||||
buf[0] = c < 0 ? avio_r8(pb) : c;
|
||||
avio_read(pb, buf + 1, 4);
|
||||
ret = avio_read(pb, buf + 1, 4);
|
||||
if (ret < 4)
|
||||
return AV_NOPTS_VALUE;
|
||||
|
||||
return ff_parse_pes_pts(buf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user