]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsedaala.c
Merge commit '50078c1c8070dd8d1c329e8117ff30ec72489039'
[ffmpeg] / libavformat / oggparsedaala.c
index af6dce0a0d494444ffdf30765dc84c5600b8de8e..24567f93a9b4aaa414ee1419077d33b18207e76e 100644 (file)
@@ -42,6 +42,7 @@ static const struct DaalaPixFmtMap list_fmts[] = {
 
 typedef struct DaalaInfoHeader {
     int init_d;
+    int fpr;
     int gpshift;
     int gpmask;
     int version_maj;
@@ -125,7 +126,16 @@ static int daala_header(AVFormatContext *s, int idx)
         hdr->gpmask  = (1 << hdr->gpshift) - 1;
 
         hdr->format.depth  = 8 + 2*(bytestream2_get_byte(&gb)-1);
+
+        hdr->fpr = bytestream2_get_byte(&gb);
+
         hdr->format.planes = bytestream2_get_byte(&gb);
+        if (hdr->format.planes > 4) {
+            av_log(s, AV_LOG_ERROR,
+                   "Invalid number of planes %d in daala pixel format map.\n",
+                   hdr->format.planes);
+            return AVERROR_INVALIDDATA;
+        }
         for (i = 0; i < hdr->format.planes; i++) {
             hdr->format.xdec[i] = bytestream2_get_byte(&gb);
             hdr->format.ydec[i] = bytestream2_get_byte(&gb);