]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpegenc.c
Provide non null class name to avoid crash with ffmpeg -h.
[ffmpeg] / libavcodec / mjpegenc.c
index 03f081703d7a087d49684372e091705d1b874f86..b5e5a827d3ab7757f00a8572a84bd1fcc64d4966 100644 (file)
@@ -4,6 +4,10 @@
  * Copyright (c) 2003 Alex Beregszaszi
  * Copyright (c) 2003-2004 Michael Niedermayer
  *
+ * Support for external huffman table, various fixes (AVID workaround),
+ * aspecting, new decode_frame mechanism and apple mjpeg-b support
+ *                                  by Alex Beregszaszi
+ *
  * This file is part of FFmpeg.
  *
  * FFmpeg is free software; you can redistribute it and/or
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
  */
 
 /**
@@ -147,8 +147,7 @@ static void jpeg_table_header(MpegEncContext *s)
                               ff_mjpeg_val_ac_luminance);
     size += put_huffman_table(s, 1, 1, ff_mjpeg_bits_ac_chrominance,
                               ff_mjpeg_val_ac_chrominance);
-    ptr[0] = size >> 8;
-    ptr[1] = size;
+    AV_WB16(ptr, size);
 }
 
 static void jpeg_put_comments(MpegEncContext *s)
@@ -179,8 +178,7 @@ static void jpeg_put_comments(MpegEncContext *s)
         put_bits(p, 16, 0); /* patched later */
         ff_put_string(p, LIBAVCODEC_IDENT, 1);
         size = strlen(LIBAVCODEC_IDENT)+3;
-        ptr[0] = size >> 8;
-        ptr[1] = size;
+        AV_WB16(ptr, size);
     }
 
     if(  s->avctx->pix_fmt == PIX_FMT_YUV420P
@@ -192,8 +190,7 @@ static void jpeg_put_comments(MpegEncContext *s)
         put_bits(p, 16, 0); /* patched later */
         ff_put_string(p, "CS=ITU601", 1);
         size = strlen("CS=ITU601")+3;
-        ptr[0] = size >> 8;
-        ptr[1] = size;
+        AV_WB16(ptr, size);
     }
 }