shorten: pass on error value from allocate_buffers() instead of returning -1
authorJustin Ruggles <justin.ruggles@gmail.com>
Fri, 16 Sep 2011 15:22:37 +0000 (11:22 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 20 Oct 2011 17:09:25 +0000 (13:09 -0400)
libavcodec/shorten.c

index ad274b4..638d886 100644 (file)
@@ -306,7 +306,7 @@ static int decode_subframe_lpc(ShortenContext *s, int channel,
 
 static int read_header(ShortenContext *s)
 {
-    int i;
+    int i, ret;
     int maxnlpc = 0;
     /* shorten signature */
     if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) {
@@ -342,8 +342,8 @@ static int read_header(ShortenContext *s)
     }
     s->nwrap = FFMAX(NWRAP, maxnlpc);
 
-    if (allocate_buffers(s))
-        return -1;
+    if ((ret = allocate_buffers(s)) < 0)
+        return ret;
 
     init_offset(s);