]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/adx.c
Fix parser not to clobber has_b_frames when extradata is set.
[ffmpeg] / libavcodec / adx.c
index 9f03e930be7e6ddd488f43f76e87f30b87495359..1e5d89c991ad40bac44acb65d05065663c8d994c 100644 (file)
@@ -34,8 +34,8 @@ void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
     coeff[1] = lrintf(-(c * c) * (1 << bits));
 }
 
-int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, int bufsize,
-                         int *header_size, int *coeff)
+int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
+                             int bufsize, int *header_size, int *coeff)
 {
     int offset, cutoff;
 
@@ -58,7 +58,7 @@ int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, int bufsize,
 
     /* channels */
     avctx->channels = buf[7];
-    if (avctx->channels > 2)
+    if (avctx->channels <= 0 || avctx->channels > 2)
         return AVERROR_INVALIDDATA;
 
     /* sample rate */