[vlc-commits] avcodec: fix codec mapping array size check

Ilkka Ollakka git at videolan.org
Fri Jan 25 16:28:36 CET 2013


vlc/vlc-2.0 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Fri Dec 28 12:53:30 2012 +0200| [8c814ce1712d6bddf16cea7fd8513641bef86dce] | committer: Jean-Baptiste Kempf

avcodec: fix codec mapping array size check
(cherry picked from commit 99ab06c7ffe189e81118f6122b1661c6c7af033c)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=8c814ce1712d6bddf16cea7fd8513641bef86dce
---

 modules/codec/avcodec/audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 46be029..45e32d0 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -425,7 +425,7 @@ vlc_fourcc_t GetVlcAudioFormat( int fmt )
         [AV_SAMPLE_FMT_FLT]  = VLC_CODEC_FL32,
         [AV_SAMPLE_FMT_DBL]  = VLC_CODEC_FL64,
     };
-    if( sizeof(fcc) / sizeof(fcc[0]) < (unsigned)fmt )
+    if( (sizeof(fcc) / sizeof(fcc[0])) > (unsigned)fmt )
         return fcc[fmt];
     return VLC_CODEC_S16N;
 }



More information about the vlc-commits mailing list