avformat/pdvenc: Don't silently truncate value
This muxer seems to intend to support output that does not begin at zero (instead of e.g. just hardcoding nb_frames_pos to 16). But then it is possible that avio_seek() returns values > INT_MAX even though the part of the file written by us can not exceed this value. So the return value of avio_seek() needs to be checked as 64bit integer and not silently truncated to int. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -158,7 +158,7 @@ static int pdv_write_trailer(AVFormatContext *s)
|
||||
PDVMuxContext *pdv = s->priv_data;
|
||||
int64_t payload_size = avio_tell(s->pb);
|
||||
const uint32_t table_gap = 4U * (pdv->max_frames - pdv->nb_frames);
|
||||
int ret;
|
||||
int64_t ret;
|
||||
|
||||
if (payload_size < 0)
|
||||
return AVERROR(EIO);
|
||||
|
||||
Reference in New Issue
Block a user