]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/roqvideodec.c
aea: Return proper error code on invalid header
[ffmpeg] / libavcodec / roqvideodec.c
index ef561a32105e28de078eab21bba1314ae60b3214..ac7d4bafe0efbc94acaf90b5f0a1fdc54578141b 100644 (file)
@@ -44,7 +44,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
     roq_qcell *qcell;
     int64_t chunk_start;
 
-    while (bytestream2_get_bytes_left(&ri->gb) > 0) {
+    while (bytestream2_get_bytes_left(&ri->gb) >= 8) {
         chunk_id   = bytestream2_get_le16(&ri->gb);
         chunk_size = bytestream2_get_le32(&ri->gb);
         chunk_arg  = bytestream2_get_le16(&ri->gb);
@@ -227,6 +227,7 @@ static av_cold int roq_decode_end(AVCodecContext *avctx)
 
 AVCodec ff_roq_decoder = {
     .name           = "roqvideo",
+    .long_name      = NULL_IF_CONFIG_SMALL("id RoQ video"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_ROQ,
     .priv_data_size = sizeof(RoqContext),
@@ -234,5 +235,4 @@ AVCodec ff_roq_decoder = {
     .close          = roq_decode_end,
     .decode         = roq_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .long_name      = NULL_IF_CONFIG_SMALL("id RoQ video"),
 };