]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rpl.c
avcodec/jpeglsdec: Return error codes from ls_decode_line()
[ffmpeg] / libavformat / rpl.c
index dbbcd13b416397a24a0cf26980fdada009cb194b..6afd373810098dd600920d5db8209173a6526782 100644 (file)
@@ -200,7 +200,7 @@ static int rpl_read_header(AVFormatContext *s)
         ast->codecpar->channels        = read_line_and_int(pb, &error);  // number of audio channels
         error |= read_line(pb, line, sizeof(line));
         ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error);  // audio bits per sample
-        strcpy(audio_type, endptr);
+        av_strlcpy(audio_type, endptr, RPL_LINE_LENGTH);
         // At least one sample uses 0 for ADPCM, which is really 4 bits
         // per sample.
         if (ast->codecpar->bits_per_coded_sample == 0)
@@ -269,8 +269,10 @@ static int rpl_read_header(AVFormatContext *s)
         read_line_and_int(pb, &error);           //   (file index)
     error |= read_line(pb, line, sizeof(line));  // offset to "helpful" sprite
     error |= read_line(pb, line, sizeof(line));  // size of "helpful" sprite
-    if (vst)
+    if (vst) {
         error |= read_line(pb, line, sizeof(line));  // offset to key frame list
+        vst->duration = number_of_chunks * rpl->frames_per_chunk;
+    }
 
     // Read the index
     avio_seek(pb, chunk_catalog_offset, SEEK_SET);