diff mbox

[FFmpeg-devel,ogg] Respect AVERROR codes returned by ogg header parsing.

Message ID CAPUDrweBot4iwWDYJMA=n7-Y8JB0-KZnX+jL-A-HTgO_9B6UWg@mail.gmail.com
State Superseded
Headers show

Commit Message

Dale Curtis Nov. 28, 2017, 9:41 p.m. UTC
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 <dalecurtis@chromium.org>
diff mbox

Patch

From 34d68a511a2d933b111964f84cfd2d0a289dec97 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecurtis@chromium.org>
Date: Tue, 28 Nov 2017 13:40:20 -0800
Subject: [PATCH] Respect AVERROR codes returned by ogg header parsing.

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 <dalecurtis@chromium.org>
---
 libavformat/oggdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 193a286e43..4ab7fdc0bd 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -544,6 +544,9 @@  static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
 
     if (os->header) {
         os->header = os->codec->header(s, idx);
+        if (os->header < 0)
+            return os->header;
+
         if (!os->header) {
             os->segp  = segp;
             os->psize = psize;
-- 
2.15.0.417.g466bffb3ac-goog