changeset 6688:91f5a23d6cd5 libavcodec

return error if buf_size is too small
author bcoudurier
date Sat, 26 Apr 2008 12:39:45 +0000
parents 798391f1ce13
children 85cb0c3f8e54
files mpegaudiodec.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mpegaudiodec.c	Sat Apr 26 12:34:37 2008 +0000
+++ b/mpegaudiodec.c	Sat Apr 26 12:39:45 2008 +0000
@@ -2570,11 +2570,10 @@
 
     len = buf_size;
 
+    *data_size = 0;
     // Discard too short frames
-    if (buf_size < HEADER_SIZE) {
-        *data_size = 0;
-        return buf_size;
-    }
+    if (buf_size < HEADER_SIZE)
+        return -1;
 
     // If only one decoder interleave is not needed
     outptr = s->frames == 1 ? out_samples : decoded_buf;