[FFmpeg-cvslog] r19877 - trunk/libavcodec/utils.c

pross subversion
Wed Sep 16 13:29:48 CEST 2009


Author: pross
Date: Wed Sep 16 13:29:47 2009
New Revision: 19877

Log:
perform sanity check on number of audio channels in avcodec_open()

Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Wed Sep 16 09:50:09 2009	(r19876)
+++ trunk/libavcodec/utils.c	Wed Sep 16 13:29:47 2009	(r19877)
@@ -471,7 +471,9 @@ int attribute_align_arg avcodec_open(AVC
     else if(avctx->width && avctx->height)
         avcodec_set_dimensions(avctx, avctx->width, avctx->height);
 
-    if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){
+#define SANE_NB_CHANNELS 128U
+    if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height) ||
+        avctx->channels > SANE_NB_CHANNELS) {
         av_freep(&avctx->priv_data);
         ret = AVERROR(EINVAL);
         goto end;



More information about the ffmpeg-cvslog mailing list