mp3: exit on parsing error in mp_decode_frame
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 22 Oct 2012 16:50:32 +0000 (18:50 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 20 Jan 2013 19:36:57 +0000 (20:36 +0100)
Properly forward mp_decode_layer3 errors, mp_decode_layer1 and
mp_decode_layer2 do not return errors.

Based on a patch by Michael Niedermayer.
(cherry picked from commit 0c03cc68386443f1e96ab6fb358220faf67cd5ff)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/mpegaudiodec.c

index cd0d26d..adb25ff 100644 (file)
@@ -1571,6 +1571,9 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples,
     default:
         nb_frames = mp_decode_layer3(s);
 
+        if (nb_frames < 0)
+            return nb_frames;
+
         s->last_buf_size=0;
         if (s->in_gb.buffer) {
             align_get_bits(&s->gb);