[FFmpeg-cvslog] ff_flac_parse_picture: assert that len is within the array

Michael Niedermayer git at videolan.org
Wed Aug 7 17:26:07 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Aug  7 16:50:59 2013 +0200| [731f7eaaade4c0cf91f8008cc30c0342caa64df1] | committer: Michael Niedermayer

ff_flac_parse_picture: assert that len is within the array

The check that gurantees this isnt recognized by coverity for
example

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=731f7eaaade4c0cf91f8008cc30c0342caa64df1
---

 libavformat/flacdec_picture.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/flacdec_picture.c b/libavformat/flacdec_picture.c
index 3c4fa6e..1b0bea2 100644
--- a/libavformat/flacdec_picture.c
+++ b/libavformat/flacdec_picture.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list