OSDN Git Service

lavf/movenc: use two explicit bytes instead of a short.
authorClément Bœsch <ubitux@gmail.com>
Wed, 8 Aug 2012 21:10:17 +0000 (23:10 +0200)
committerClément Bœsch <ubitux@gmail.com>
Wed, 8 Aug 2012 21:13:52 +0000 (23:13 +0200)
This also avoids a pointless cast.

Idea-by: Reimar Döffinger
libavformat/movenc.c

index 89a181a..695bd43 100644 (file)
@@ -3145,12 +3145,12 @@ static int mov_write_subtitle_end_packet(AVFormatContext *s,
                                          int stream_index,
                                          int64_t dts) {
     AVPacket end;
-    short data = 0;
+    uint8_t data[2] = {0};
     int ret;
 
     av_init_packet(&end);
-    end.size = sizeof (short);
-    end.data = (char *)&data;
+    end.size = sizeof(data);
+    end.data = data;
     end.pts = dts;
     end.dts = dts;
     end.duration = 0;