ff_flac_parse_picture: assert that len is within the array
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Aug 2013 14:50:59 +0000 (16:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Aug 2013 15:18:05 +0000 (17:18 +0200)
The check that gurantees this isnt recognized by coverity for
example

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/flacdec_picture.c

index 3c4fa6e6f8ff18a892873183a867b90d7d0f4f08..1b0bea2dd0dc08308e9932186beae24fe6142205 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avassert.h"
 #include "avformat.h"
 #include "flacdec.h"
 #include "id3v2.h"
@@ -59,6 +60,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
             ret = AVERROR_INVALIDDATA;
         goto fail;
     }
+    av_assert0(len < sizeof(mimetype));
     mimetype[len] = 0;
 
     while (mime->id != AV_CODEC_ID_NONE) {