[FFmpeg-devel] [PATCH 2/2] avformat/rpl: check av_get_packet() for failure

Michael Niedermayer michaelni at gmx.at
Fri Feb 6 13:15:16 CET 2015


On Fri, Feb 06, 2015 at 09:28:03AM +0000, Paul B Mahol wrote:
> On 2/5/15, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Thu, Feb 05, 2015 at 03:08:17PM +0000, Paul B Mahol wrote:
> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> >> ---
> >>  libavformat/rpl.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/libavformat/rpl.c b/libavformat/rpl.c
> >> index c1229e8..a05bff1 100644
> >> --- a/libavformat/rpl.c
> >> +++ b/libavformat/rpl.c
> >> @@ -308,6 +308,8 @@ static int rpl_read_packet(AVFormatContext *s,
> >> AVPacket *pkt)
> >>              return AVERROR(EIO);
> >>
> >>          ret = av_get_packet(pb, pkt, frame_size);
> >> +        if (ret < 0)
> >> +            return ret;
> >>          if (ret != frame_size) {
> >>              av_free_packet(pkt);
> >>              return AVERROR(EIO);
> >> @@ -323,6 +325,8 @@ static int rpl_read_packet(AVFormatContext *s,
> >> AVPacket *pkt)
> >>          }
> >>      } else {
> >>          ret = av_get_packet(pb, pkt, index_entry->size);
> >> +        if (ret < 0)
> >> +            return ret;
> >
> > ret is unsigned, so this cannot be true
> 
> Should I then make ret signed?

if that doesnt introduce any bugs, i suggest yes

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150206/ff992a0c/attachment.asc>


More information about the ffmpeg-devel mailing list