Fixes bad parens in the above patch.

- dale

On Tue, Nov 28, 2017 at 2:03 PM, Dale Curtis <dalecur...@chromium.org>
wrote:

> Actually packet() was broken too, updated the patch to fix this case too.
>
> - dale
>
> On Tue, Nov 28, 2017 at 1:41 PM, Dale Curtis <dalecur...@chromium.org>
> wrote:
>
>> Fixes ticket #6804. All of the ogg header parsers may return
>> standard AVERROR codes; these return values should not be
>> treated as success.
>>
>> Signed-off-by: Dale Curtis <dalecur...@chromium.org>
>>
>>
>>
>
From 8d3b21ab59d835430f057cfb40a63318b25e7014 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecur...@chromium.org>
Date: Tue, 28 Nov 2017 13:40:20 -0800
Subject: [PATCH] Respect AVERROR codes returned by ogg parsers.

Fixes ticket #6804. All of the ogg header and packet parsers may
return standard AVERROR codes; these return values should not be
treated as success.

Signed-off-by: Dale Curtis <dalecur...@chromium.org>
---
 libavformat/oggdec.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 193a286e43..281eba44cf 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -543,7 +543,9 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
     os->incomplete = 0;
 
     if (os->header) {
-        os->header = os->codec->header(s, idx);
+        if ((ret = os->codec->header(s, idx)) < 0)
+            return ret;
+        os->header = ret;
         if (!os->header) {
             os->segp  = segp;
             os->psize = psize;
@@ -574,8 +576,10 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
     } else {
         os->pflags    = 0;
         os->pduration = 0;
-        if (os->codec && os->codec->packet)
-            os->codec->packet(s, idx);
+        if (os->codec && os->codec->packet) {
+            if ((ret = os->codec->packet(s, idx)) < 0)
+                return ret;
+        }
         if (sid)
             *sid = idx;
         if (dstart)
-- 
2.15.0.417.g466bffb3ac-goog

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to