dvbsub encoder, patch by Wolfram Gloger < wmglo AH dent POIS med POIS uni-muenchen...
[ffmpeg.git] / libavcodec / dvbsub.c
index 8efe8b2f981cff39f8f0754a02558185fe011454..d85836b8b6b6ee5a0a0d340684c43a49f6656bc4 100644 (file)
@@ -343,10 +343,10 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
         for (object_id = 0; object_id < h->num_rects; object_id++) {
             /* Object Data segment */
 
-            if (h->rects[region_id].nb_colors <= 4) {
+            if (h->rects[object_id].nb_colors <= 4) {
                 /* 2 bpp, some decoders do not support it correctly */
                 bpp_index = 0;
-            } else if (h->rects[region_id].nb_colors <= 16) {
+            } else if (h->rects[object_id].nb_colors <= 16) {
                 /* 4 bpp, standard encoding */
                 bpp_index = 1;
             } else {