]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/binkaudio.c
avutil/hwcontext_cuda: Only handle CUDA hardware frames
[ffmpeg] / libavcodec / binkaudio.c
index 96cf968c66e6e2bb4eccc2986eaab865d7279cd6..64a08b8608189f5acb59121bb8e53517f968f48d 100644 (file)
@@ -95,6 +95,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) {
         // audio is already interleaved for the RDFT format variant
         avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+        if (sample_rate > INT_MAX / avctx->channels)
+            return AVERROR_INVALIDDATA;
         sample_rate  *= avctx->channels;
         s->channels = 1;
         if (!s->version_b)
@@ -151,7 +153,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 static float get_float(GetBitContext *gb)
 {
     int power = get_bits(gb, 5);
-    float f = ldexpf(get_bits_long(gb, 23), power - 23);
+    float f = ldexpf(get_bits(gb, 23), power - 23);
     if (get_bits1(gb))
         f = -f;
     return f;