[08/17] asfdec: Check the return value of asf_read_stream_properties

Message ID 1380406879-6174-8-git-send-email-martin@martin.st
State Committed
Commit cc41167aede4c101ad17eeffa8f39bb6c23d3dad
Headers show

Commit Message

Martin Storsjö Sept. 28, 2013, 10:21 p.m.
This makes sure errors in setting stream parameters are passed
on to the caller. This avoids successfully opening files while
some parameters aren't filled in properly.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
---
 libavformat/asfdec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vittorio Giovara Sept. 29, 2013, 8:57 p.m. | #1
On Sun, Sep 29, 2013 at 12:21 AM, Martin Storsjö <martin@martin.st> wrote:
> This makes sure errors in setting stream parameters are passed
> on to the caller. This avoids successfully opening files while
> some parameters aren't filled in properly.
>
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: libav-stable@libav.org
> ---
>  libavformat/asfdec.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Ok.
Vittorio

Patch

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index b99cb02..5b4366e 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -743,7 +743,9 @@  static int asf_read_header(AVFormatContext *s)
             if (ret < 0)
                 return ret;
         } else if (!ff_guidcmp(&g, &ff_asf_stream_header)) {
-            asf_read_stream_properties(s, gsize);
+            int ret = asf_read_stream_properties(s, gsize);
+            if (ret < 0)
+                return ret;
         } else if (!ff_guidcmp(&g, &ff_asf_comment_header)) {
             asf_read_content_desc(s, gsize);
         } else if (!ff_guidcmp(&g, &ff_asf_language_guid)) {