]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdsubdec.c
mpegvideo: fix size of array
[ffmpeg] / libavcodec / dvdsubdec.c
index 02f70be90663b19e1ee14155f03b5af5340d6fed..5d6db41d35d41fe3e2364288349d4cd3ab33feef 100644 (file)
@@ -314,7 +314,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
             if (h < 0)
                 h = 0;
             if (w > 0 && h > 0) {
-                if (sub_header->rects != NULL) {
+                if (sub_header->rects) {
                     for (i = 0; i < sub_header->num_rects; i++) {
                         av_freep(&sub_header->rects[i]->pict.data[0]);
                         av_freep(&sub_header->rects[i]->pict.data[1]);
@@ -360,7 +360,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
     if (sub_header->num_rects > 0)
         return is_menu;
  fail:
-    if (sub_header->rects != NULL) {
+    if (!sub_header->rects) {
         for (i = 0; i < sub_header->num_rects; i++) {
             av_freep(&sub_header->rects[i]->pict.data[0]);
             av_freep(&sub_header->rects[i]->pict.data[1]);
@@ -391,7 +391,7 @@ static int find_smallest_bounding_rectangle(AVSubtitle *s)
     int y1, y2, x1, x2, y, w, h, i;
     uint8_t *bitmap;
 
-    if (s->num_rects == 0 || s->rects == NULL || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
+    if (s->num_rects == 0 || !s->rects || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
         return 0;
 
     for(i = 0; i < s->rects[0]->nb_colors; i++) {