]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xl.c
aacdec: Remove erroneous reference to global gain from the out of bounds scalefactor...
[ffmpeg] / libavcodec / xl.c
index 4f17ae54f2a6c6da38b91a155d9a67eed638162c..0ebc9467e04036541207d3ae8e33b61091f362db 100644 (file)
@@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx,
     V = a->pic.data[2];
 
     stride = avctx->width - 4;
+
+    if (buf_size < avctx->width * avctx->height) {
+        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     for (i = 0; i < avctx->height; i++) {
         /* lines are stored in reversed order */
         buf += stride;
@@ -139,14 +145,13 @@ static av_cold int decode_end(AVCodecContext *avctx){
 }
 
 AVCodec ff_xl_decoder = {
-    "xl",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_VIXL,
-    sizeof(VideoXLContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
+    .name           = "xl",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_VIXL,
+    .priv_data_size = sizeof(VideoXLContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"),
 };