[FFmpeg-devel] [PATCH] avformat/rtsp: Fix unchecked return value
Michael Niedermayer
michaelni at gmx.at
Fri Apr 10 14:18:54 CEST 2015
On Fri, Apr 10, 2015 at 02:15:33PM +0200, Thomas Volkert wrote:
>
> Am 09.04.2015 um 20:34 schrieb Himangi Saraogi:
> >---
> >This fixes CID 733718.
> >
> > libavformat/rtsp.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> >diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> >index c9871ce..42dbe96 100644
> >--- a/libavformat/rtsp.c
> >+++ b/libavformat/rtsp.c
> >@@ -174,11 +174,15 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
> > *end = AV_NOPTS_VALUE;
> > get_word_sep(buf, sizeof(buf), "-", &p);
> >- av_parse_time(start, buf, 1);
> >+ if (av_parse_time(start, buf, 1) < 0) {
> >+ av_log(NULL, AV_LOG_ERROR, "Invalid interval start specification '%s'\n", buf);
> >+ return;
> >+ }
> > if (*p == '-') {
> > p++;
> > get_word_sep(buf, sizeof(buf), "-", &p);
> >- av_parse_time(end, buf, 1);
> >+ if (av_parse_time(end, buf, 1) < 0)
> >+ av_log(NULL, AV_LOG_ERROR, "Invalid interval end specification '%s'\n", buf);
> > }
> > }
>
> The patch is okay, the returned values for start/end are fine in the
> error case - thanks.
applied
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/20150410/f375443e/attachment.asc>
More information about the ffmpeg-devel
mailing list