diff mbox series

[FFmpeg-devel,3/5] avformat/mxfdec: also check for non-positive number of channels

Message ID 20211129005930.7188-3-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,1/5] avformat/mxf: support MCA audio information
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Marton Balint Nov. 29, 2021, 12:59 a.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mxfdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 8cb66b73c4..e0a52e3883 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2843,8 +2843,8 @@  static int mxf_parse_structural_metadata(MXFContext *mxf)
 
             current_channel = 0;
 
-            if (descriptor->channels >= FF_SANE_NB_CHANNELS) {
-                av_log(mxf->fc, AV_LOG_ERROR, "max number of channels %d reached\n", FF_SANE_NB_CHANNELS);
+            if (descriptor->channels <= 0 || descriptor->channels >= FF_SANE_NB_CHANNELS) {
+                av_log(mxf->fc, AV_LOG_ERROR, "Invalid number of channels %d, must be less than %d\n", descriptor->channels, FF_SANE_NB_CHANNELS);
                 return AVERROR_INVALIDDATA;
             }