On 8/21/11 4:03 PM, Anton Khirnov wrote:
              pkt_data = av_realloc(pkt_data, pkt_size);
              zstream.avail_out = pkt_size - zstream.total_out;
              zstream.next_out = pkt_data + zstream.total_out;
-            result = inflate(&zstream, Z_NO_FLUSH);
+            if (pkt_data) {
+                result = inflate(&zstream, Z_NO_FLUSH);
+            } else
+                result = Z_MEM_ERROR;

              pkt_data = av_realloc(pkt_data, pkt_size);
              bzstream.avail_out = pkt_size - bzstream.total_out_lo32;
              bzstream.next_out = pkt_data + bzstream.total_out_lo32;
-            result = BZ2_bzDecompress(&bzstream);
+            if (pkt_data) {
+                result = BZ2_bzDecompress(&bzstream);
+            } else
+                result = BZ_MEM_ERROR;
          } while (result==BZ_OK&&  pkt_size<10000000);

Why using library specific errors and not the libav specific?
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to