]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dds.c
avcodec/hevc_ps: Remove gotos from ff_hevc_parse_sps()
[ffmpeg] / libavcodec / dds.c
index 501057e2a259fcab398e7e46f0c339bab9383dda..3f6f7f8cb7352826b4adf529ab9886093cd6b51f 100644 (file)
@@ -2,20 +2,20 @@
  * DirectDraw Surface image decoder
  * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -627,11 +627,11 @@ static int dds_decode(AVCodecContext *avctx, void *data,
 
         if (ctx->paletted) {
             int i;
-            uint32_t *p = (uint32_t *)frame->data[1];
-
             /* Use the first 1024 bytes as palette, then copy the rest. */
-            for (i = 0; i < 256; i++)
-                p[i] = bytestream2_get_le32(gbc);
+            bytestream2_get_buffer(gbc, frame->data[1], 256 * 4);
+            if (HAVE_BIGENDIAN)
+                for (i = 0; i < 256; i++)
+                    AV_WB32(frame->data[1] + i*4, AV_RL32(frame->data[1] + i*4));
 
             frame->palette_has_changed = 1;
         }