]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/takdec.c
dds: validate compressed source buffer size
[ffmpeg] / libavcodec / takdec.c
index 16ccdba9b14908f77365712e1d1482a3f802ea0a..c84cca448d3074e20bfb8cb64db159c99a8bc993 100644 (file)
@@ -487,7 +487,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded,
         v += s->adsp.scalarproduct_int16(&s->residues[i], filter,
                                          FFALIGN(filter_order, 16));
 
-        v = (av_clip(v >> filter_quant, -8192, 8191) << dshift) - *decoded;
+        v = (av_clip_intp2(v >> filter_quant, 13) << dshift) - *decoded;
         *decoded++ = v;
         s->residues[filter_order + i] = v >> dshift;
     }
@@ -657,7 +657,7 @@ static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
             v += s->adsp.scalarproduct_int16(&s->residues[i], filter,
                                              FFALIGN(filter_order, 16));
 
-            p1[i] = (av_clip(v >> 10, -8192, 8191) << dshift) - p1[i];
+            p1[i] = (av_clip_intp2(v >> 10, 13) << dshift) - p1[i];
         }
 
         emms_c();
@@ -927,7 +927,7 @@ AVCodec ff_tak_decoder = {
     .init_static_data = tak_init_static_data,
     .close            = tak_decode_close,
     .decode           = tak_decode_frame,
-    .capabilities     = CODEC_CAP_DR1,
+    .capabilities     = AV_CODEC_CAP_DR1,
     .sample_fmts      = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
                                                         AV_SAMPLE_FMT_S16P,
                                                         AV_SAMPLE_FMT_S32P,