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

Michael Niedermayer michaelni at gmx.at
Thu Feb 5 18:14:51 CET 2015


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- 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/20150205/3946f9cb/attachment.asc>


More information about the ffmpeg-devel mailing list