]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ptx.c
audio_frame_queue: Clean up ff_af_queue_log_state debug function
[ffmpeg] / libavcodec / ptx.c
index 75b42d50732d06ecd1ab9b5d5ac1cf1cc55288c0..e0f5a1b301f46e42b3efb49e8bf7920885f1e7c7 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
@@ -84,7 +85,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     ptr    = p->data[0];
     stride = p->linesize[0];
 
-    for (y = 0; y < h && buf_end - buf < w * bytes_per_pixel; y++) {
+    for (y = 0; y < h && buf_end - buf >= w * bytes_per_pixel; y++) {
 #if HAVE_BIGENDIAN
         unsigned int x;
         for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
@@ -119,11 +120,11 @@ static av_cold int ptx_end(AVCodecContext *avctx) {
 AVCodec ff_ptx_decoder = {
     .name           = "ptx",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_PTX,
+    .id             = AV_CODEC_ID_PTX,
     .priv_data_size = sizeof(PTXContext),
     .init           = ptx_init,
     .close          = ptx_end,
     .decode         = ptx_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
+    .long_name      = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
 };